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)?}}" |
Alexander Potapenko | 6a94c1e | 2013-01-22 09:27:00 +0000 | [diff] [blame] | 8 | // CHECK-ASAN: libclang_rt.asan_osx_dynamic.dylib" |
Alexey Samsonov | 1059653 | 2012-11-25 13:40:21 +0000 | [diff] [blame] | 9 | // CHECK-ASAN: stdc++ |
Alexey Samsonov | 69b77d7 | 2012-11-21 14:17:42 +0000 | [diff] [blame] | 10 | |
| 11 | // RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \ |
| 12 | // RUN: -fPIC -shared -fsanitize=address %s -o %t.so 2>&1 \ |
| 13 | // RUN: | FileCheck --check-prefix=CHECK-DYN-ASAN %s |
| 14 | |
Alexey Samsonov | 803dd9e | 2012-11-21 15:52:36 +0000 | [diff] [blame] | 15 | // CHECK-DYN-ASAN: "{{.*}}ld{{(.exe)?}}" |
Alexey Samsonov | 69b77d7 | 2012-11-21 14:17:42 +0000 | [diff] [blame] | 16 | // CHECK-DYN-ASAN: "-dylib" |
Alexander Potapenko | 6a94c1e | 2013-01-22 09:27:00 +0000 | [diff] [blame] | 17 | // CHECK-DYN-ASAN-NOT: libclang_rt.asan_osx_dynamic.dylib |
Alexey Samsonov | 69b77d7 | 2012-11-21 14:17:42 +0000 | [diff] [blame] | 18 | // CHECK-DYN-ASAN: "-undefined" |
| 19 | // CHECK-DYN-ASAN: "dynamic_lookup" |
Alexander Potapenko | 6a94c1e | 2013-01-22 09:27:00 +0000 | [diff] [blame] | 20 | // CHECK-DYN-ASAN-NOT: libclang_rt.asan_osx_dynamic.dylib |
Alexey Samsonov | 69b77d7 | 2012-11-21 14:17:42 +0000 | [diff] [blame] | 21 | |
| 22 | // RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \ |
| 23 | // RUN: -fsanitize=undefined %s -o %t.o 2>&1 \ |
| 24 | // RUN: | FileCheck --check-prefix=CHECK-UBSAN %s |
| 25 | |
Alexey Samsonov | 803dd9e | 2012-11-21 15:52:36 +0000 | [diff] [blame] | 26 | // CHECK-UBSAN: "{{.*}}ld{{(.exe)?}}" |
Alexey Samsonov | 69b77d7 | 2012-11-21 14:17:42 +0000 | [diff] [blame] | 27 | // CHECK-UBSAN: libclang_rt.ubsan_osx.a" |
Alexey Samsonov | 1059653 | 2012-11-25 13:40:21 +0000 | [diff] [blame] | 28 | // CHECK-UBSAN: stdc++ |
Alexey Samsonov | 69b77d7 | 2012-11-21 14:17:42 +0000 | [diff] [blame] | 29 | |
| 30 | // RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \ |
Richard Smith | a0a628f | 2013-02-23 02:53:19 +0000 | [diff] [blame] | 31 | // RUN: -fsanitize=bounds -fsanitize-undefined-trap-on-error \ |
| 32 | // RUN: %s -o %t.o 2>&1 \ |
Joey Gouly | 8548908 | 2012-11-23 10:39:49 +0000 | [diff] [blame] | 33 | // RUN: | FileCheck --check-prefix=CHECK-BOUNDS %s |
| 34 | |
| 35 | // CHECK-BOUNDS: "{{.*}}ld{{(.exe)?}}" |
| 36 | // CHECK-BOUNDS-NOT: libclang_rt.ubsan_osx.a" |
Joey Gouly | 8548908 | 2012-11-23 10:39:49 +0000 | [diff] [blame] | 37 | |
| 38 | // RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \ |
Alexey Samsonov | 69b77d7 | 2012-11-21 14:17:42 +0000 | [diff] [blame] | 39 | // RUN: -fPIC -shared -fsanitize=undefined %s -o %t.so 2>&1 \ |
| 40 | // RUN: | FileCheck --check-prefix=CHECK-DYN-UBSAN %s |
| 41 | |
Alexey Samsonov | 803dd9e | 2012-11-21 15:52:36 +0000 | [diff] [blame] | 42 | // CHECK-DYN-UBSAN: "{{.*}}ld{{(.exe)?}}" |
Alexey Samsonov | 69b77d7 | 2012-11-21 14:17:42 +0000 | [diff] [blame] | 43 | // CHECK-DYN-UBSAN: "-dylib" |
Alexey Samsonov | 2cb3d30 | 2013-01-21 08:45:02 +0000 | [diff] [blame] | 44 | // CHECK-DYN-UBSAN: libclang_rt.ubsan_osx.a |
Joey Gouly | 8548908 | 2012-11-23 10:39:49 +0000 | [diff] [blame] | 45 | |
| 46 | // RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \ |
Richard Smith | a0a628f | 2013-02-23 02:53:19 +0000 | [diff] [blame] | 47 | // RUN: -fsanitize=bounds -fsanitize-undefined-trap-on-error \ |
| 48 | // RUN: %s -o %t.so -fPIC -shared 2>&1 \ |
Joey Gouly | 8548908 | 2012-11-23 10:39:49 +0000 | [diff] [blame] | 49 | // RUN: | FileCheck --check-prefix=CHECK-DYN-BOUNDS %s |
| 50 | |
| 51 | // CHECK-DYN-BOUNDS: "{{.*}}ld{{(.exe)?}}" |
| 52 | // CHECK-DYN-BOUNDS-NOT: libclang_rt.ubsan_osx.a |