aboutsummaryrefslogtreecommitdiff
path: root/test/Driver/ubsan-ld.c
blob: 133d7a3a6d7b3548d12ca551ffbc0bf36ebf1657 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Test UndefinedBehaviorSanitizer ld flags.

// RUN: %clang -fsanitize=undefined %s -### -o %t.o 2>&1 \
// RUN:     -target i386-unknown-linux \
// RUN:     --sysroot=%S/Inputs/basic_linux_tree \
// RUN:   | FileCheck --check-prefix=CHECK-LINUX %s
// CHECK-LINUX: "{{.*}}ld{{(.exe)?}}"
// CHECK-LINUX-NOT: "-lc"
// CHECK-LINUX: libclang_rt.ubsan-i386.a"
// CHECK-LINUX: "-lpthread"

// RUN: %clang -fsanitize=undefined %s -### -o %t.o 2>&1 \
// RUN:     -target i386-unknown-linux \
// RUN:     --sysroot=%S/Inputs/basic_linux_tree \
// RUN:     -shared \
// RUN:   | FileCheck --check-prefix=CHECK-LINUX-SHARED %s
// CHECK-LINUX-SHARED: "{{.*}}ld{{(.exe)?}}"
// CHECK-LINUX-SHARED-NOT: "-lc"
// CHECK-LINUX-SHARED: libclang_rt.ubsan-i386.a"
// CHECK-LINUX-SHARED: "-lpthread"

// RUN: %clang -fsanitize=bounds %s -### -o %t.o 2>&1 \
// RUN:     -target i386-unknown-linux \
// RUN:     --sysroot=%S/Inputs/basic_linux_tree \
// RUN:   | FileCheck --check-prefix=CHECK-LINUX1 %s
// CHECK-LINUX1: "{{.*}}ld{{(.exe)?}}"
// CHECK-LINUX1-NOT: libclang_rt.ubsan-i386.a"
// CHECK-LINUX1-NOT: "-lpthread"