blob: b3ba12ee434f3da32e0716523d88730bc4a59796 [file] [log] [blame]
Duncan P. N. Exon Smith540c3cd2014-05-16 04:09:41 +00001// Test instrumented profiling ld flags.
2//
3// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
4// RUN: -target i386-unknown-linux -fprofile-instr-generate \
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
8//
9// CHECK-LINUX-I386: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
10// CHECK-LINUX-I386: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}libclang_rt.profile-i386.a" {{.*}} "-lc"
11//
12// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
13// RUN: -target x86_64-unknown-linux -fprofile-instr-generate \
14// RUN: -resource-dir=%S/Inputs/resource_dir \
15// RUN: --sysroot=%S/Inputs/basic_linux_tree \
16// RUN: | FileCheck --check-prefix=CHECK-LINUX-X86-64 %s
17//
18// CHECK-LINUX-X86-64: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
19// CHECK-LINUX-X86-64: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}libclang_rt.profile-x86_64.a" {{.*}} "-lc"
20//
21// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
Justin Bognerc7701242015-05-12 05:44:36 +000022// RUN: -target x86_64-unknown-linux -fprofile-instr-generate -nostdlib \
23// RUN: -resource-dir=%S/Inputs/resource_dir \
24// RUN: --sysroot=%S/Inputs/basic_linux_tree \
25// RUN: | FileCheck --check-prefix=CHECK-LINUX-NOSTDLIB-X86-64 %s
26//
27// CHECK-LINUX-NOSTDLIB-X86-64: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
28// CHECK-LINUX-NOSTDLIB-X86-64: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}libclang_rt.profile-x86_64.a"
29//
30// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
Duncan P. N. Exon Smith540c3cd2014-05-16 04:09:41 +000031// RUN: -target x86_64-unknown-freebsd -fprofile-instr-generate \
32// RUN: -resource-dir=%S/Inputs/resource_dir \
33// RUN: --sysroot=%S/Inputs/basic_freebsd64_tree \
34// RUN: | FileCheck --check-prefix=CHECK-FREEBSD-X86-64 %s
35//
36// CHECK-FREEBSD-X86-64: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
37// CHECK-FREEBSD-X86-64: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}freebsd{{/|\\\\}}libclang_rt.profile-x86_64.a"
38//
39// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
40// RUN: -shared \
41// RUN: -target i386-unknown-linux -fprofile-instr-generate \
42// RUN: -resource-dir=%S/Inputs/resource_dir \
43// RUN: --sysroot=%S/Inputs/basic_linux_tree \
44// RUN: | FileCheck --check-prefix=CHECK-LINUX-I386-SHARED %s
45//
46// CHECK-LINUX-I386-SHARED: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
Alexey Samsonovcbbd2fd2014-11-14 00:16:26 +000047// CHECK-LINUX-I386-SHARED: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}libclang_rt.profile-i386.a" {{.*}} "-lc"
Duncan P. N. Exon Smith540c3cd2014-05-16 04:09:41 +000048//
49// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
50// RUN: -shared \
51// RUN: -target x86_64-unknown-linux -fprofile-instr-generate \
52// RUN: -resource-dir=%S/Inputs/resource_dir \
53// RUN: --sysroot=%S/Inputs/basic_linux_tree \
54// RUN: | FileCheck --check-prefix=CHECK-LINUX-X86-64-SHARED %s
55//
56// CHECK-LINUX-X86-64-SHARED: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
Alexey Samsonovcbbd2fd2014-11-14 00:16:26 +000057// CHECK-LINUX-X86-64-SHARED: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}libclang_rt.profile-x86_64.a" {{.*}} "-lc"
Duncan P. N. Exon Smith540c3cd2014-05-16 04:09:41 +000058//
59// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
60// RUN: -shared \
61// RUN: -target x86_64-unknown-freebsd -fprofile-instr-generate \
62// RUN: -resource-dir=%S/Inputs/resource_dir \
63// RUN: --sysroot=%S/Inputs/basic_freebsd64_tree \
64// RUN: | FileCheck --check-prefix=CHECK-FREEBSD-X86-64-SHARED %s
65//
66// CHECK-FREEBSD-X86-64-SHARED: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
Alexey Samsonovcbbd2fd2014-11-14 00:16:26 +000067// CHECK-FREEBSD-X86-64-SHARED: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}freebsd{{/|\\\\}}libclang_rt.profile-x86_64.a"
Justin Bognerc7701242015-05-12 05:44:36 +000068//
69// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
70// RUN: -target x86_64-apple-darwin14 -fprofile-instr-generate \
71// RUN: -resource-dir=%S/Inputs/resource_dir \
72// RUN: | FileCheck --check-prefix=CHECK-DARWIN-X86-64 %s
73//
74// CHECK-DARWIN-X86-64: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
75// CHECK-DARWIN-X86-64: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}darwin{{/|\\\\}}libclang_rt.profile_osx.a"
76//
77// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
78// RUN: -target x86_64-apple-darwin14 -fprofile-instr-generate -nostdlib \
79// RUN: -resource-dir=%S/Inputs/resource_dir \
80// RUN: | FileCheck --check-prefix=CHECK-DARWIN-NOSTDLIB-X86-64 %s
81//
82// CHECK-DARWIN-NOSTDLIB-X86-64: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
83// CHECK-DARWIN-NOSTDLIB-X86-64: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}darwin{{/|\\\\}}libclang_rt.profile_osx.a"
Justin Bogner2fd95f62015-05-12 06:30:48 +000084//
85// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
86// RUN: -target arm64-apple-ios -fprofile-instr-generate \
87// RUN: -resource-dir=%S/Inputs/resource_dir \
88// RUN: | FileCheck --check-prefix=CHECK-DARWIN-ARM64 %s
89//
90// CHECK-DARWIN-ARM64: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
91// CHECK-DARWIN-ARM64: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}darwin{{/|\\\\}}libclang_rt.profile_ios.a"
Vedant Kumar0affb932015-11-10 00:20:34 +000092//
93// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
94// RUN: -target armv7-apple-darwin -mtvos-version-min=8.3 -fprofile-instr-generate \
95// RUN: -resource-dir=%S/Inputs/resource_dir \
96// RUN: | FileCheck --check-prefix=CHECK-TVOS-ARMV7 %s
97//
98// CHECK-TVOS-ARMV7: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
99// CHECK-TVOS-ARMV7: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}darwin{{/|\\\\}}libclang_rt.profile_tvos.a"
100//
101// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
102// RUN: -target armv7s-apple-darwin10 -mwatchos-version-min=2.0 -arch armv7k -fprofile-instr-generate \
103// RUN: -resource-dir=%S/Inputs/resource_dir \
104// RUN: | FileCheck --check-prefix=CHECK-WATCHOS-ARMV7 %s
105//
106// CHECK-WATCHOS-ARMV7: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
107// CHECK-WATCHOS-ARMV7: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}darwin{{/|\\\\}}libclang_rt.profile_watchos.a"