xref: /minix3/external/bsd/llvm/dist/clang/test/Driver/instrprof-ld.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // Test instrumented profiling ld flags.
2*0a6a1f1dSLionel Sambuc //
3*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
4*0a6a1f1dSLionel Sambuc // RUN:     -target i386-unknown-linux -fprofile-instr-generate \
5*0a6a1f1dSLionel Sambuc // RUN:     -resource-dir=%S/Inputs/resource_dir \
6*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
7*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-LINUX-I386 %s
8*0a6a1f1dSLionel Sambuc //
9*0a6a1f1dSLionel Sambuc // CHECK-LINUX-I386: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
10*0a6a1f1dSLionel Sambuc // CHECK-LINUX-I386: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}libclang_rt.profile-i386.a" {{.*}} "-lc"
11*0a6a1f1dSLionel Sambuc //
12*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
13*0a6a1f1dSLionel Sambuc // RUN:     -target x86_64-unknown-linux -fprofile-instr-generate \
14*0a6a1f1dSLionel Sambuc // RUN:     -resource-dir=%S/Inputs/resource_dir \
15*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
16*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-LINUX-X86-64 %s
17*0a6a1f1dSLionel Sambuc //
18*0a6a1f1dSLionel Sambuc // CHECK-LINUX-X86-64: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
19*0a6a1f1dSLionel Sambuc // CHECK-LINUX-X86-64: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}libclang_rt.profile-x86_64.a" {{.*}} "-lc"
20*0a6a1f1dSLionel Sambuc //
21*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
22*0a6a1f1dSLionel Sambuc // RUN:     -target x86_64-unknown-freebsd -fprofile-instr-generate \
23*0a6a1f1dSLionel Sambuc // RUN:     -resource-dir=%S/Inputs/resource_dir \
24*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_freebsd64_tree \
25*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-FREEBSD-X86-64 %s
26*0a6a1f1dSLionel Sambuc //
27*0a6a1f1dSLionel Sambuc // CHECK-FREEBSD-X86-64: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
28*0a6a1f1dSLionel Sambuc // CHECK-FREEBSD-X86-64: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}freebsd{{/|\\\\}}libclang_rt.profile-x86_64.a"
29*0a6a1f1dSLionel Sambuc //
30*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
31*0a6a1f1dSLionel Sambuc // RUN:     -shared \
32*0a6a1f1dSLionel Sambuc // RUN:     -target i386-unknown-linux -fprofile-instr-generate \
33*0a6a1f1dSLionel Sambuc // RUN:     -resource-dir=%S/Inputs/resource_dir \
34*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
35*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-LINUX-I386-SHARED %s
36*0a6a1f1dSLionel Sambuc //
37*0a6a1f1dSLionel Sambuc // CHECK-LINUX-I386-SHARED: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
38*0a6a1f1dSLionel Sambuc // CHECK-LINUX-I386-SHARED: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}libclang_rt.profile-i386.a" {{.*}} "-lc"
39*0a6a1f1dSLionel Sambuc //
40*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
41*0a6a1f1dSLionel Sambuc // RUN:     -shared \
42*0a6a1f1dSLionel Sambuc // RUN:     -target x86_64-unknown-linux -fprofile-instr-generate \
43*0a6a1f1dSLionel Sambuc // RUN:     -resource-dir=%S/Inputs/resource_dir \
44*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
45*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-LINUX-X86-64-SHARED %s
46*0a6a1f1dSLionel Sambuc //
47*0a6a1f1dSLionel Sambuc // CHECK-LINUX-X86-64-SHARED: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
48*0a6a1f1dSLionel Sambuc // CHECK-LINUX-X86-64-SHARED: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}libclang_rt.profile-x86_64.a" {{.*}} "-lc"
49*0a6a1f1dSLionel Sambuc //
50*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
51*0a6a1f1dSLionel Sambuc // RUN:     -shared \
52*0a6a1f1dSLionel Sambuc // RUN:     -target x86_64-unknown-freebsd -fprofile-instr-generate \
53*0a6a1f1dSLionel Sambuc // RUN:     -resource-dir=%S/Inputs/resource_dir \
54*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_freebsd64_tree \
55*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-FREEBSD-X86-64-SHARED %s
56*0a6a1f1dSLionel Sambuc //
57*0a6a1f1dSLionel Sambuc // CHECK-FREEBSD-X86-64-SHARED: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
58*0a6a1f1dSLionel Sambuc // CHECK-FREEBSD-X86-64-SHARED: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}freebsd{{/|\\\\}}libclang_rt.profile-x86_64.a"
59