blob: 4a249d5197a24b347523445749b5a08507713b68 [file] [log] [blame]
Evgeniy Stepanova6ddc022012-04-25 08:59:22 +00001// 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 Smithc4dabad2012-11-05 22:04:41 +00007//
Evgeniy Stepanova6ddc022012-04-25 08:59:22 +00008// CHECK-LINUX: "{{.*}}ld{{(.exe)?}}"
9// CHECK-LINUX-NOT: "-lc"
Evgeniy Stepanov99f8f172012-04-25 09:28:10 +000010// CHECK-LINUX: libclang_rt.asan-i386.a"
Evgeniy Stepanova6ddc022012-04-25 08:59:22 +000011// CHECK-LINUX: "-lpthread"
12// CHECK-LINUX: "-ldl"
13// CHECK-LINUX: "-export-dynamic"
Richard Smithc4dabad2012-11-05 22:04:41 +000014//
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 Stepanova6ddc022012-04-25 08:59:22 +000020// CHECK-ANDROID: "{{.*}}ld{{(.exe)?}}"
21// CHECK-ANDROID-NOT: "-lc"
Evgeniy Stepanovad5dc102012-09-12 09:39:37 +000022// CHECK-ANDROID: libclang_rt.asan-arm-android.so"
23// CHECK-ANDROID-NOT: "-lpthread"
Richard Smithc4dabad2012-11-05 22:04:41 +000024//
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 Stepanova6ddc022012-04-25 08:59:22 +000031// CHECK-ANDROID-SHARED: "{{.*}}ld{{(.exe)?}}"
32// CHECK-ANDROID-SHARED-NOT: "-lc"
Evgeniy Stepanovad5dc102012-09-12 09:39:37 +000033// CHECK-ANDROID-SHARED: libclang_rt.asan-arm-android.so"
34// CHECK-ANDROID-SHARED-NOT: "-lpthread"