[PATCH] D72278: [test] On Mac, don't try to use result of sysctl command if calling it failed.

David Spickett via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 6 08:31:36 PST 2020


DavidSpickett created this revision.
DavidSpickett added reviewers: nadav, beanz.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
DavidSpickett added a comment.

I found this running lit tests on a Mac that doesn't have sysctl available. Not very familiar with it so I'm not sure why that is the case for our particular machine.

So this change is me assuming the intention was to just print and carry on if "sysctl" fails.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D72278

Files:
  llvm/test/lit.cfg.py


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):


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72278.236376.patch
Type: text/x-patch
Size: 808 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200106/f2951563/attachment.bin>


More information about the llvm-commits mailing list