1 // Test coverage ld flags.
3 // RUN: %clang -### %s 2>&1 \
4 // RUN: --target=i386-unknown-linux -fprofile-arcs \
5 // RUN: -resource-dir=%S/Inputs/resource_dir \
6 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
7 // RUN: | FileCheck --check-prefix=CHECK-LINUX-I386 %s
9 // RUN: %clang -### %s 2>&1 \
10 // RUN: --target=i386-unknown-linux --coverage \
11 // RUN: -resource-dir=%S/Inputs/resource_dir \
12 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
13 // RUN: | FileCheck --check-prefix=CHECK-LINUX-I386 %s
15 // CHECK-LINUX-I386-NOT: "-u__llvm_profile_runtime"
16 // CHECK-LINUX-I386: /Inputs/resource_dir{{/|\\\\}}lib{{.*}}i386-unknown-linux{{.*}}libclang_rt.profile.a"
17 // CHECK-LINUX-I386-NOT: "-u__llvm_profile_runtime"
18 // CHECK-LINUX-I386: "-lc"
20 // RUN: %clang -### %s 2>&1 \
21 // RUN: --target=x86_64-unknown-linux --coverage -fuse-ld=ld \
22 // RUN: -resource-dir=%S/Inputs/resource_dir \
23 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
24 // RUN: | FileCheck --check-prefix=CHECK-LINUX-X86-64 %s
26 // CHECK-LINUX-X86-64: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
27 // CHECK-LINUX-X86-64: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{.*}}linux{{.*}}libclang_rt.profile.a" {{.*}} "-lc"
29 // RUN: %clang -### %s 2>&1 \
30 // RUN: --target=x86_64-unknown-freebsd --coverage -fuse-ld=ld \
31 // RUN: -resource-dir=%S/Inputs/resource_dir \
32 // RUN: --sysroot=%S/Inputs/basic_freebsd64_tree \
33 // RUN: | FileCheck --check-prefix=CHECK-FREEBSD-X86-64 %s
35 // CHECK-FREEBSD-X86-64: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
36 // CHECK-FREEBSD-X86-64: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}x86_64-unknown-freebsd{{/|\\\\}}libclang_rt.profile.a"
38 // RUN: %clang -### %s 2>&1 \
39 // RUN: --target=x86_64-unknown-netbsd --coverage -fuse-ld=ld \
40 // RUN: -resource-dir=%S/Inputs/resource_dir \
41 // RUN: --sysroot=%S/Inputs/basic_netbsd_tree \
42 // RUN: | FileCheck --check-prefix=CHECK-NETBSD-X86-64 %s
44 // CHECK-NETBSD-X86-64: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
45 // CHECK-NETBSD-X86-64: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}x86_64-unknown-netbsd{{/|\\\\}}libclang_rt.profile.a"
47 // RUN: %clang -### %s 2>&1 \
48 // RUN: --target=x86_64-unknown-openbsd --coverage -fuse-ld=ld \
49 // RUN: -resource-dir=%S/Inputs/resource_dir \
50 // RUN: --sysroot=%S/Inputs/basic_openbsd_tree \
51 // RUN: | FileCheck --check-prefix=CHECK-OPENBSD-X86-64 %s
53 // CHECK-OPENBSD-X86-64: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
54 // CHECK-OPENBSD-X86-64: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}x86_64-unknown-openbsd{{/|\\\\}}libclang_rt.profile.a"
56 // RUN: %clang -### %s 2>&1 \
57 // RUN: --target=arm-linux-androideabi --coverage -fuse-ld=ld \
58 // RUN: -resource-dir=%S/Inputs/resource_dir \
59 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
60 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-ARM %s
62 // CHECK-ANDROID-ARM: "{{(.*[^.0-9A-Z_a-z])?}}ld.lld{{(.exe)?}}"
63 // CHECK-ANDROID-ARM: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}arm-unknown-linux-android{{/|\\\\}}libclang_rt.profile.a"