2013-06-23 19:28:48 +08:00
|
|
|
// Test coverage ld flags.
|
|
|
|
//
|
2020-05-09 14:13:19 +08:00
|
|
|
// RUN: %clang -no-canonical-prefixes %s -### 2>&1 \
|
|
|
|
// RUN: -target i386-unknown-linux -fprofile-arcs \
|
|
|
|
// RUN: -resource-dir=%S/Inputs/resource_dir \
|
|
|
|
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-LINUX-I386 %s
|
|
|
|
//
|
|
|
|
// RUN: %clang -no-canonical-prefixes %s -### 2>&1 \
|
|
|
|
// RUN: -target i386-unknown-linux --coverage \
|
2013-06-23 19:28:48 +08:00
|
|
|
// RUN: -resource-dir=%S/Inputs/resource_dir \
|
|
|
|
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-LINUX-I386 %s
|
|
|
|
//
|
Revert "[InstrProfiling] Don't generate __llvm_profile_runtime_user"
This broke the check-profile tests on Mac, see comment on the code
review.
> This is no longer needed, we can add __llvm_profile_runtime directly
> to llvm.compiler.used or llvm.used to achieve the same effect.
>
> Differential Revision: https://reviews.llvm.org/D98325
This reverts commit c7712087cbb505d324e1149fa224f607c91a8c6a.
Also reverting the dependent follow-up commit:
Revert "[InstrProfiling] Generate runtime hook for ELF platforms"
> When using -fprofile-list to selectively apply instrumentation only
> to certain files or functions, we may end up with a binary that doesn't
> have any counters in the case where no files were selected. However,
> because on Linux and Fuchsia, we pass -u__llvm_profile_runtime, the
> runtime would still be pulled in and incur some non-trivial overhead,
> especially in the case when the continuous or runtime counter relocation
> mode is being used. A better way would be to pull in the profile runtime
> only when needed by declaring the __llvm_profile_runtime symbol in the
> translation unit only when needed.
>
> This approach was already used prior to 9a041a75221ca, but we changed it
> to always generate the __llvm_profile_runtime due to a TAPI limitation.
> Since TAPI is only used on Mach-O platforms, we could use the early
> emission of __llvm_profile_runtime there, and on other platforms we
> could change back to the earlier approach where the symbol is generated
> later only when needed. We can stop passing -u__llvm_profile_runtime to
> the linker on Linux and Fuchsia since the generated undefined symbol in
> each translation unit that needed it serves the same purpose.
>
> Differential Revision: https://reviews.llvm.org/D98061
This reverts commit 87fd09b25f8892e07b7ba11525baa9c3ec3e5d3f.
2021-03-12 20:43:36 +08:00
|
|
|
// CHECK-LINUX-I386-NOT: "-u__llvm_profile_runtime"
|
2020-05-09 14:13:19 +08:00
|
|
|
// CHECK-LINUX-I386: /Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}libclang_rt.profile-i386.a"
|
Revert "[InstrProfiling] Don't generate __llvm_profile_runtime_user"
This broke the check-profile tests on Mac, see comment on the code
review.
> This is no longer needed, we can add __llvm_profile_runtime directly
> to llvm.compiler.used or llvm.used to achieve the same effect.
>
> Differential Revision: https://reviews.llvm.org/D98325
This reverts commit c7712087cbb505d324e1149fa224f607c91a8c6a.
Also reverting the dependent follow-up commit:
Revert "[InstrProfiling] Generate runtime hook for ELF platforms"
> When using -fprofile-list to selectively apply instrumentation only
> to certain files or functions, we may end up with a binary that doesn't
> have any counters in the case where no files were selected. However,
> because on Linux and Fuchsia, we pass -u__llvm_profile_runtime, the
> runtime would still be pulled in and incur some non-trivial overhead,
> especially in the case when the continuous or runtime counter relocation
> mode is being used. A better way would be to pull in the profile runtime
> only when needed by declaring the __llvm_profile_runtime symbol in the
> translation unit only when needed.
>
> This approach was already used prior to 9a041a75221ca, but we changed it
> to always generate the __llvm_profile_runtime due to a TAPI limitation.
> Since TAPI is only used on Mach-O platforms, we could use the early
> emission of __llvm_profile_runtime there, and on other platforms we
> could change back to the earlier approach where the symbol is generated
> later only when needed. We can stop passing -u__llvm_profile_runtime to
> the linker on Linux and Fuchsia since the generated undefined symbol in
> each translation unit that needed it serves the same purpose.
>
> Differential Revision: https://reviews.llvm.org/D98061
This reverts commit 87fd09b25f8892e07b7ba11525baa9c3ec3e5d3f.
2021-03-12 20:43:36 +08:00
|
|
|
// CHECK-LINUX-I386-NOT: "-u__llvm_profile_runtime"
|
2020-05-09 14:13:19 +08:00
|
|
|
// CHECK-LINUX-I386: "-lc"
|
2013-06-23 19:28:48 +08:00
|
|
|
//
|
|
|
|
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
|
2017-01-08 18:04:07 +08:00
|
|
|
// RUN: -target x86_64-unknown-linux --coverage -fuse-ld=ld \
|
2013-06-23 19:28:48 +08:00
|
|
|
// RUN: -resource-dir=%S/Inputs/resource_dir \
|
|
|
|
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-LINUX-X86-64 %s
|
|
|
|
//
|
|
|
|
// CHECK-LINUX-X86-64: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
|
2014-03-29 01:53:17 +08:00
|
|
|
// CHECK-LINUX-X86-64: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}libclang_rt.profile-x86_64.a" {{.*}} "-lc"
|
|
|
|
//
|
2014-02-20 21:57:37 +08:00
|
|
|
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
|
2017-01-08 18:04:07 +08:00
|
|
|
// RUN: -target x86_64-unknown-freebsd --coverage -fuse-ld=ld \
|
2014-02-20 21:57:37 +08:00
|
|
|
// RUN: -resource-dir=%S/Inputs/resource_dir \
|
|
|
|
// RUN: --sysroot=%S/Inputs/basic_freebsd64_tree \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-FREEBSD-X86-64 %s
|
|
|
|
//
|
|
|
|
// CHECK-FREEBSD-X86-64: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
|
|
|
|
// CHECK-FREEBSD-X86-64: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}freebsd{{/|\\\\}}libclang_rt.profile-x86_64.a"
|
2015-01-29 07:23:36 +08:00
|
|
|
//
|
|
|
|
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
|
2017-01-08 18:04:07 +08:00
|
|
|
// RUN: -target arm-linux-androideabi --coverage -fuse-ld=ld \
|
2015-01-29 07:23:36 +08:00
|
|
|
// RUN: -resource-dir=%S/Inputs/resource_dir \
|
|
|
|
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-ARM %s
|
|
|
|
//
|
2015-03-26 04:17:20 +08:00
|
|
|
// CHECK-ANDROID-ARM: "{{(.*[^.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
|
2015-01-29 07:23:36 +08:00
|
|
|
// CHECK-ANDROID-ARM: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}libclang_rt.profile-arm-android.a"
|