Alexey Samsonov | 69b77d7 | 2012-11-21 14:17:42 +0000 | [diff] [blame] | 1 | // Test sanitizer link flags on Darwin. |
| 2 | |
| 3 | // RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \ |
| 4 | // RUN: -fsanitize=address %s -o %t.o 2>&1 \ |
| 5 | // RUN: | FileCheck --check-prefix=CHECK-ASAN %s |
| 6 | |
Alexey Samsonov | 803dd9e | 2012-11-21 15:52:36 +0000 | [diff] [blame] | 7 | // CHECK-ASAN: "{{.*}}ld{{(.exe)?}}" |
Alexey Samsonov | 69b77d7 | 2012-11-21 14:17:42 +0000 | [diff] [blame] | 8 | // CHECK-ASAN: libclang_rt.asan_osx.a" |
| 9 | // CHECK-ASAN: "-lstdc++" |
| 10 | // CHECK-ASAN: "-framework" "CoreFoundation" |
| 11 | |
| 12 | // RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \ |
| 13 | // RUN: -fPIC -shared -fsanitize=address %s -o %t.so 2>&1 \ |
| 14 | // RUN: | FileCheck --check-prefix=CHECK-DYN-ASAN %s |
| 15 | |
Alexey Samsonov | 803dd9e | 2012-11-21 15:52:36 +0000 | [diff] [blame] | 16 | // CHECK-DYN-ASAN: "{{.*}}ld{{(.exe)?}}" |
Alexey Samsonov | 69b77d7 | 2012-11-21 14:17:42 +0000 | [diff] [blame] | 17 | // CHECK-DYN-ASAN: "-dylib" |
| 18 | // CHECK-DYN-ASAN-NOT: libclang_rt.asan_osx.a |
| 19 | // CHECK-DYN-ASAN: "-undefined" |
| 20 | // CHECK-DYN-ASAN: "dynamic_lookup" |
| 21 | // CHECK-DYN-ASAN-NOT: libclang_rt.asan_osx.a |
| 22 | |
| 23 | // RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \ |
| 24 | // RUN: -fsanitize=undefined %s -o %t.o 2>&1 \ |
| 25 | // RUN: | FileCheck --check-prefix=CHECK-UBSAN %s |
| 26 | |
Alexey Samsonov | 803dd9e | 2012-11-21 15:52:36 +0000 | [diff] [blame] | 27 | // CHECK-UBSAN: "{{.*}}ld{{(.exe)?}}" |
Alexey Samsonov | 69b77d7 | 2012-11-21 14:17:42 +0000 | [diff] [blame] | 28 | // CHECK-UBSAN: libclang_rt.ubsan_osx.a" |
| 29 | // CHECK-UBSAN: "-lstdc++" |
| 30 | |
| 31 | // RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \ |
| 32 | // RUN: -fPIC -shared -fsanitize=undefined %s -o %t.so 2>&1 \ |
| 33 | // RUN: | FileCheck --check-prefix=CHECK-DYN-UBSAN %s |
| 34 | |
Alexey Samsonov | 803dd9e | 2012-11-21 15:52:36 +0000 | [diff] [blame] | 35 | // CHECK-DYN-UBSAN: "{{.*}}ld{{(.exe)?}}" |
Alexey Samsonov | 69b77d7 | 2012-11-21 14:17:42 +0000 | [diff] [blame] | 36 | // CHECK-DYN-UBSAN: "-dylib" |
| 37 | // CHECK-DYN-UBSAN-NOT: libclang_rt.ubsan_osx.a |
| 38 | // CHECK-DYN-UBSAN: "-undefined" |
| 39 | // CHECK-DYN-UBSAN: "dynamic_lookup" |
| 40 | // CHECK-DYN-UBSAN-NOT: libclang_rt.ubsan_osx.a |