Alexey Samsonov | 8368b37 | 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 | 062441b | 2012-11-21 15:52:36 +0000 | [diff] [blame] | 7 | // CHECK-ASAN: "{{.*}}ld{{(.exe)?}}" |
Alexey Samsonov | e0619f5 | 2012-11-25 13:40:21 +0000 | [diff] [blame] | 8 | // CHECK-ASAN: stdc++ |
Kuba Brecka | e899e79 | 2014-11-04 23:38:57 +0000 | [diff] [blame^] | 9 | // CHECK-ASAN: libclang_rt.asan_osx_dynamic.dylib" |
Kuba Brecka | 9ff912d | 2014-11-04 17:35:17 +0000 | [diff] [blame] | 10 | // CHECK-ASAN: "-rpath" "@executable_path" |
Kuba Brecka | e899e79 | 2014-11-04 23:38:57 +0000 | [diff] [blame^] | 11 | // CHECK-ASAN: "-rpath" "{{.*}}lib{{.*}}darwin" |
Alexey Samsonov | 8368b37 | 2012-11-21 14:17:42 +0000 | [diff] [blame] | 12 | |
| 13 | // RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \ |
Alexander Potapenko | 868cca9 | 2013-11-15 16:07:44 +0000 | [diff] [blame] | 14 | // RUN: -fsanitize=address -mios-simulator-version-min=7.0 %s -o %t.o 2>&1 \ |
| 15 | // RUN: | FileCheck --check-prefix=CHECK-ASAN-IOSSIM %s |
| 16 | |
| 17 | // CHECK-ASAN-IOSSIM: "{{.*}}ld{{(.exe)?}}" |
Alexander Potapenko | 4fe1301 | 2013-11-15 16:57:57 +0000 | [diff] [blame] | 18 | // CHECK-ASAN-IOSSIM: lc++ |
Kuba Brecka | e899e79 | 2014-11-04 23:38:57 +0000 | [diff] [blame^] | 19 | // CHECK-ASAN-IOSSIM: libclang_rt.asan_iossim_dynamic.dylib" |
Kuba Brecka | 9ff912d | 2014-11-04 17:35:17 +0000 | [diff] [blame] | 20 | // CHECK-ASAN-IOSSIM: "-rpath" "@executable_path" |
Kuba Brecka | e899e79 | 2014-11-04 23:38:57 +0000 | [diff] [blame^] | 21 | // CHECK-ASAN-IOSSIM: "-rpath" "{{.*}}lib{{.*}}darwin" |
Alexander Potapenko | 868cca9 | 2013-11-15 16:07:44 +0000 | [diff] [blame] | 22 | |
| 23 | // RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \ |
Alexey Samsonov | 8368b37 | 2012-11-21 14:17:42 +0000 | [diff] [blame] | 24 | // RUN: -fPIC -shared -fsanitize=address %s -o %t.so 2>&1 \ |
| 25 | // RUN: | FileCheck --check-prefix=CHECK-DYN-ASAN %s |
| 26 | |
Alexey Samsonov | 062441b | 2012-11-21 15:52:36 +0000 | [diff] [blame] | 27 | // CHECK-DYN-ASAN: "{{.*}}ld{{(.exe)?}}" |
Alexey Samsonov | 8368b37 | 2012-11-21 14:17:42 +0000 | [diff] [blame] | 28 | // CHECK-DYN-ASAN: "-dylib" |
Kuba Brecka | e899e79 | 2014-11-04 23:38:57 +0000 | [diff] [blame^] | 29 | // CHECK-DYN-ASAN: libclang_rt.asan_osx_dynamic.dylib" |
Kuba Brecka | 9ff912d | 2014-11-04 17:35:17 +0000 | [diff] [blame] | 30 | // CHECK-DYN-ASAN: "-rpath" "@executable_path" |
Kuba Brecka | e899e79 | 2014-11-04 23:38:57 +0000 | [diff] [blame^] | 31 | // CHECK-DYN-ASAN: "-rpath" "{{.*}}lib{{.*}}darwin" |
Alexey Samsonov | 8368b37 | 2012-11-21 14:17:42 +0000 | [diff] [blame] | 32 | |
| 33 | // RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \ |
| 34 | // RUN: -fsanitize=undefined %s -o %t.o 2>&1 \ |
| 35 | // RUN: | FileCheck --check-prefix=CHECK-UBSAN %s |
| 36 | |
Alexey Samsonov | 062441b | 2012-11-21 15:52:36 +0000 | [diff] [blame] | 37 | // CHECK-UBSAN: "{{.*}}ld{{(.exe)?}}" |
Alexey Samsonov | 8368b37 | 2012-11-21 14:17:42 +0000 | [diff] [blame] | 38 | // CHECK-UBSAN: libclang_rt.ubsan_osx.a" |
Alexey Samsonov | e0619f5 | 2012-11-25 13:40:21 +0000 | [diff] [blame] | 39 | // CHECK-UBSAN: stdc++ |
Alexey Samsonov | 8368b37 | 2012-11-21 14:17:42 +0000 | [diff] [blame] | 40 | |
| 41 | // RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \ |
Richard Smith | 539e4a7 | 2013-02-23 02:53:19 +0000 | [diff] [blame] | 42 | // RUN: -fsanitize=bounds -fsanitize-undefined-trap-on-error \ |
| 43 | // RUN: %s -o %t.o 2>&1 \ |
Joey Gouly | ebc59d5 | 2012-11-23 10:39:49 +0000 | [diff] [blame] | 44 | // RUN: | FileCheck --check-prefix=CHECK-BOUNDS %s |
| 45 | |
| 46 | // CHECK-BOUNDS: "{{.*}}ld{{(.exe)?}}" |
| 47 | // CHECK-BOUNDS-NOT: libclang_rt.ubsan_osx.a" |
Joey Gouly | ebc59d5 | 2012-11-23 10:39:49 +0000 | [diff] [blame] | 48 | |
| 49 | // RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \ |
Alexey Samsonov | 8368b37 | 2012-11-21 14:17:42 +0000 | [diff] [blame] | 50 | // RUN: -fPIC -shared -fsanitize=undefined %s -o %t.so 2>&1 \ |
| 51 | // RUN: | FileCheck --check-prefix=CHECK-DYN-UBSAN %s |
| 52 | |
Alexey Samsonov | 062441b | 2012-11-21 15:52:36 +0000 | [diff] [blame] | 53 | // CHECK-DYN-UBSAN: "{{.*}}ld{{(.exe)?}}" |
Alexey Samsonov | 8368b37 | 2012-11-21 14:17:42 +0000 | [diff] [blame] | 54 | // CHECK-DYN-UBSAN: "-dylib" |
Alexey Samsonov | 969be24 | 2013-01-21 08:45:02 +0000 | [diff] [blame] | 55 | // CHECK-DYN-UBSAN: libclang_rt.ubsan_osx.a |
Joey Gouly | ebc59d5 | 2012-11-23 10:39:49 +0000 | [diff] [blame] | 56 | |
| 57 | // RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \ |
Richard Smith | 539e4a7 | 2013-02-23 02:53:19 +0000 | [diff] [blame] | 58 | // RUN: -fsanitize=bounds -fsanitize-undefined-trap-on-error \ |
| 59 | // RUN: %s -o %t.so -fPIC -shared 2>&1 \ |
Joey Gouly | ebc59d5 | 2012-11-23 10:39:49 +0000 | [diff] [blame] | 60 | // RUN: | FileCheck --check-prefix=CHECK-DYN-BOUNDS %s |
| 61 | |
| 62 | // CHECK-DYN-BOUNDS: "{{.*}}ld{{(.exe)?}}" |
| 63 | // CHECK-DYN-BOUNDS-NOT: libclang_rt.ubsan_osx.a |