Evgeniy Stepanov | a6ddc02 | 2012-04-25 08:59:22 +0000 | [diff] [blame] | 1 | // Test AddressSanitizer ld flags. |
| 2 | |
| 3 | // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ |
| 4 | // RUN: -target i386-unknown-linux -faddress-sanitizer \ |
| 5 | // RUN: --sysroot=%S/Inputs/basic_linux_tree \ |
| 6 | // RUN: | FileCheck --check-prefix=CHECK-LINUX %s |
Richard Smith | c4dabad | 2012-11-05 22:04:41 +0000 | [diff] [blame] | 7 | // |
Evgeniy Stepanov | a6ddc02 | 2012-04-25 08:59:22 +0000 | [diff] [blame] | 8 | // CHECK-LINUX: "{{.*}}ld{{(.exe)?}}" |
| 9 | // CHECK-LINUX-NOT: "-lc" |
Evgeniy Stepanov | 99f8f17 | 2012-04-25 09:28:10 +0000 | [diff] [blame] | 10 | // CHECK-LINUX: libclang_rt.asan-i386.a" |
Evgeniy Stepanov | a6ddc02 | 2012-04-25 08:59:22 +0000 | [diff] [blame] | 11 | // CHECK-LINUX: "-lpthread" |
| 12 | // CHECK-LINUX: "-ldl" |
| 13 | // CHECK-LINUX: "-export-dynamic" |
Richard Smith | c4dabad | 2012-11-05 22:04:41 +0000 | [diff] [blame] | 14 | // |
| 15 | // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ |
| 16 | // RUN: -target arm-linux-androideabi -fsanitize=address \ |
| 17 | // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ |
| 18 | // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s |
| 19 | // |
Evgeniy Stepanov | a6ddc02 | 2012-04-25 08:59:22 +0000 | [diff] [blame] | 20 | // CHECK-ANDROID: "{{.*}}ld{{(.exe)?}}" |
| 21 | // CHECK-ANDROID-NOT: "-lc" |
Evgeniy Stepanov | ad5dc10 | 2012-09-12 09:39:37 +0000 | [diff] [blame] | 22 | // CHECK-ANDROID: libclang_rt.asan-arm-android.so" |
| 23 | // CHECK-ANDROID-NOT: "-lpthread" |
Richard Smith | c4dabad | 2012-11-05 22:04:41 +0000 | [diff] [blame] | 24 | // |
| 25 | // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ |
| 26 | // RUN: -target arm-linux-androideabi -fsanitize=address \ |
| 27 | // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ |
| 28 | // RUN: -shared \ |
| 29 | // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SHARED %s |
| 30 | // |
Evgeniy Stepanov | a6ddc02 | 2012-04-25 08:59:22 +0000 | [diff] [blame] | 31 | // CHECK-ANDROID-SHARED: "{{.*}}ld{{(.exe)?}}" |
| 32 | // CHECK-ANDROID-SHARED-NOT: "-lc" |
Evgeniy Stepanov | ad5dc10 | 2012-09-12 09:39:37 +0000 | [diff] [blame] | 33 | // CHECK-ANDROID-SHARED: libclang_rt.asan-arm-android.so" |
| 34 | // CHECK-ANDROID-SHARED-NOT: "-lpthread" |