diff options
author | Kuba Brecka <kuba.brecka@gmail.com> | 2014-12-05 22:19:35 +0000 |
---|---|---|
committer | Kuba Brecka <kuba.brecka@gmail.com> | 2014-12-05 22:19:35 +0000 |
commit | 721ec18fd35095700d46be4981d16c92722d6552 (patch) | |
tree | a4a65763e78c05e16489cc90dcb3e6390752f079 | |
parent | da692131956c4c71cdd494cf3fd1df4739dca192 (diff) |
Recommit of r223513 and r223514.
Reviewed at http://reviews.llvm.org/D6488
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223533 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/asan/TestCases/Darwin/objc-odr.mm | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/asan/TestCases/Darwin/objc-odr.mm b/test/asan/TestCases/Darwin/objc-odr.mm new file mode 100644 index 000000000..72bc39c80 --- /dev/null +++ b/test/asan/TestCases/Darwin/objc-odr.mm @@ -0,0 +1,23 @@ +// Regression test for +// https://code.google.com/p/address-sanitizer/issues/detail?id=360. + +// RUN: %clang_asan %s -o %t -framework Foundation +// RUN: %run %t 2>&1 | FileCheck %s + +#import <Foundation/Foundation.h> + +void f() { + int y = 7; + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{ + dispatch_sync(dispatch_get_main_queue(), ^{ + printf("num = %d\n", y); + }); + }); +} + +int main() { + NSLog(@"Hello world"); +} + +// CHECK-NOT: AddressSanitizer: odr-violation +// CHECK: Hello world |