Index: llvm/test/lit.cfg.py =================================================================== --- llvm/test/lit.cfg.py +++ llvm/test/lit.cfg.py @@ -329,10 +329,11 @@ stdout=subprocess.PIPE) except OSError: print('Could not exec sysctl') - result = sysctl_cmd.stdout.read().decode('ascii') - if -1 != result.find('hw.optional.fma: 1'): - config.available_features.add('fma3') - sysctl_cmd.wait() + else: + result = sysctl_cmd.stdout.read().decode('ascii') + if -1 != result.find('hw.optional.fma: 1'): + config.available_features.add('fma3') + sysctl_cmd.wait() # .debug_frame is not emitted for targeting Windows x64. if not re.match(r'^x86_64.*-(windows-gnu|windows-msvc)', config.target_triple):