[PATCH] D14610: [tsan] Add a Darwin-specific lit test directory

Kuba Brecka via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 12 04:48:47 PST 2015


kubabrecka updated this revision to Diff 40032.
kubabrecka added a comment.

> Why is the file called "objc_bootstrap"? What are we bootstrapping here?


It was meant that TSan can actually bootstrap fine.  Never mind, renamed to "objc-simple".

> What about .m files?


Added.


http://reviews.llvm.org/D14610

Files:
  test/tsan/Darwin/lit.local.cfg
  test/tsan/Darwin/objc-simple.mm
  test/tsan/lit.cfg

Index: test/tsan/lit.cfg
===================================================================
--- test/tsan/lit.cfg
+++ test/tsan/lit.cfg
@@ -64,7 +64,7 @@
 config.substitutions.append( ("%deflake ", os.path.join(os.path.dirname(__file__), "deflake.bash")) )
 
 # Default test suffixes.
-config.suffixes = ['.c', '.cc', '.cpp']
+config.suffixes = ['.c', '.cc', '.cpp', '.m', '.mm']
 
 # ThreadSanitizer tests are currently supported on FreeBSD, Linux and Darwin.
 if config.host_os not in ['FreeBSD', 'Linux', 'Darwin']:
Index: test/tsan/Darwin/objc-simple.mm
===================================================================
--- test/tsan/Darwin/objc-simple.mm
+++ test/tsan/Darwin/objc-simple.mm
@@ -0,0 +1,13 @@
+// Test that a simple Obj-C program runs and exits without any warnings.
+
+// RUN: %clang_tsan %s -o %t -framework Foundation
+// RUN: %run %t 2>&1
+
+#import <Foundation/Foundation.h>
+
+int main() {
+  NSLog(@"Hello world");
+}
+
+// CHECK: Hello world
+// CHECK-NOT: WARNING: ThreadSanitizer
Index: test/tsan/Darwin/lit.local.cfg
===================================================================
--- test/tsan/Darwin/lit.local.cfg
+++ test/tsan/Darwin/lit.local.cfg
@@ -0,0 +1,9 @@
+def getRoot(config):
+  if not config.parent:
+    return config
+  return getRoot(config.parent)
+
+root = getRoot(config)
+
+if root.host_os not in ['Darwin']:
+  config.unsupported = True


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14610.40032.patch
Type: text/x-patch
Size: 1397 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151112/a7dcf540/attachment.bin>


More information about the llvm-commits mailing list