[compiler-rt] r260394 - Add tests for -m32
Alexey Samsonov via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 10 15:59:09 PST 2016
You can significantly reduce the amount of RUN-lines, and increase test
portability by configuring profile test-suite for multiple architectures
that are supported. E.g. see test/ubsan/CMakeLists.txt
On Wed, Feb 10, 2016 at 9:57 AM, Xinliang David Li via llvm-commits <
llvm-commits at lists.llvm.org> wrote:
> Author: davidxl
> Date: Wed Feb 10 11:57:55 2016
> New Revision: 260394
>
> URL: http://llvm.org/viewvc/llvm-project?rev=260394&view=rev
> Log:
> Add tests for -m32
>
> Modified:
> compiler-rt/trunk/test/profile/Linux/coverage_ctors.cpp
> compiler-rt/trunk/test/profile/Linux/coverage_dtor.cpp
> compiler-rt/trunk/test/profile/Linux/coverage_shared.test
> compiler-rt/trunk/test/profile/Linux/coverage_test.cpp
>
> Modified: compiler-rt/trunk/test/profile/Linux/coverage_ctors.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/profile/Linux/coverage_ctors.cpp?rev=260394&r1=260393&r2=260394&view=diff
>
> ==============================================================================
> --- compiler-rt/trunk/test/profile/Linux/coverage_ctors.cpp (original)
> +++ compiler-rt/trunk/test/profile/Linux/coverage_ctors.cpp Wed Feb 10
> 11:57:55 2016
> @@ -2,6 +2,11 @@
> // RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t
> // RUN: llvm-profdata merge -o %t.profdata %t.profraw
> // RUN: llvm-cov show %t -instr-profile %t.profdata -filename-equivalence
> 2>&1 | FileCheck %s
> +// 32 bit testing.
> +// RUN: %clang_profgen -x c++ -std=c++11 -fuse-ld=gold
> -fcoverage-mapping -m32 -o %t.32 %s
> +// RUN: env LLVM_PROFILE_FILE=%t.32.profraw %run %t.32
> +// RUN: llvm-profdata merge -o %t.32.profdata %t.32.profraw
> +// RUN: llvm-cov show %t.32 -instr-profile %t.32.profdata
> -filename-equivalence 2>&1 | FileCheck %s
>
> struct Base {
> int B;
>
> Modified: compiler-rt/trunk/test/profile/Linux/coverage_dtor.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/profile/Linux/coverage_dtor.cpp?rev=260394&r1=260393&r2=260394&view=diff
>
> ==============================================================================
> --- compiler-rt/trunk/test/profile/Linux/coverage_dtor.cpp (original)
> +++ compiler-rt/trunk/test/profile/Linux/coverage_dtor.cpp Wed Feb 10
> 11:57:55 2016
> @@ -2,6 +2,11 @@
> // RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t
> // RUN: llvm-profdata merge -o %t.profdata %t.profraw
> // RUN: llvm-cov show %t -instr-profile %t.profdata -filename-equivalence
> 2>&1 | FileCheck %s
> +// 32 bit testing
> +// RUN: %clang -x c++ -fno-exceptions -std=c++11 -fuse-ld=gold
> -fprofile-instr-generate -fcoverage-mapping -m32 -o %t.32 %s
> +// RUN: env LLVM_PROFILE_FILE=%t.32.profraw %run %t.32
> +// RUN: llvm-profdata merge -o %t.32.profdata %t.32.profraw
> +// RUN: llvm-cov show %t.32 -instr-profile %t.32.profdata
> -filename-equivalence 2>&1 | FileCheck %s
>
> int g = 100;
> struct Base {
>
> Modified: compiler-rt/trunk/test/profile/Linux/coverage_shared.test
> URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/profile/Linux/coverage_shared.test?rev=260394&r1=260393&r2=260394&view=diff
>
> ==============================================================================
> --- compiler-rt/trunk/test/profile/Linux/coverage_shared.test (original)
> +++ compiler-rt/trunk/test/profile/Linux/coverage_shared.test Wed Feb 10
> 11:57:55 2016
> @@ -14,3 +14,18 @@ RUN: llvm-profdata merge -o %t-shared.pr
> RUN: llvm-cov show -instr-profile %t-shared.profdata %t.d/a.shared |
> FileCheck --check-prefix=COV %S/../Inputs/instrprof-dynamic-a.cpp
> RUN: llvm-cov show -instr-profile %t-static.profdata %t-static |
> FileCheck --check-prefix=COV %S/../Inputs/instrprof-dynamic-a.cpp
>
> +
> +RUN: %clang_profgen -fdata-sections -ffunction-sections
> -fcoverage-mapping -m32 -c -o %t.d/a.32.shared.o -fPIC
> %S/../Inputs/instrprof-dynamic-a.cpp
> +RUN: %clang_profgen -fdata-sections -ffunction-sections -fuse-ld=gold
> -Wl,--gc-sections -fcoverage-mapping -m32 -o %t.d/a.32.shared -fPIC -shared
> %S/../Inputs/instrprof-dynamic-a.cpp
> +RUN: %clang_profgen -fdata-sections -ffunction-sections -fuse-ld=gold
> -Wl,--gc-sections -m32 -o %t.32-shared -fPIC -rpath %t.d %t.d/a.32.shared
> %S/../Inputs/instrprof-dynamic-b.cpp %S/../Inputs/instrprof-dynamic-main.cpp
> +
> +RUN: %clang_profgen -fdata-sections -ffunction-sections -fuse-ld=gold
> -Wl,--gc-sections -m32 -o %t.32-static %t.d/a.32.shared.o
> %S/../Inputs/instrprof-dynamic-b.cpp %S/../Inputs/instrprof-dynamic-main.cpp
> +
> +RUN: env LLVM_PROFILE_FILE=%t.32-static.profraw %run %t.32-static
> +RUN: env LLVM_PROFILE_FILE=%t.32-shared.profraw %run %t.32-shared
> +
> +RUN: llvm-profdata merge -o %t.32-static.profdata %t.32-static.profraw
> +RUN: llvm-profdata merge -o %t.32-shared.profdata %t.32-shared.profraw
> +
> +RUN: llvm-cov show -instr-profile %t.32-shared.profdata %t.d/a.32.shared
> | FileCheck --check-prefix=COV %S/../Inputs/instrprof-dynamic-a.cpp
> +RUN: llvm-cov show -instr-profile %t.32-static.profdata %t.32-static |
> FileCheck --check-prefix=COV %S/../Inputs/instrprof-dynamic-a.cpp
>
> Modified: compiler-rt/trunk/test/profile/Linux/coverage_test.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/profile/Linux/coverage_test.cpp?rev=260394&r1=260393&r2=260394&view=diff
>
> ==============================================================================
> --- compiler-rt/trunk/test/profile/Linux/coverage_test.cpp (original)
> +++ compiler-rt/trunk/test/profile/Linux/coverage_test.cpp Wed Feb 10
> 11:57:55 2016
> @@ -2,11 +2,16 @@
> // RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t
> // RUN: llvm-profdata merge -o %t.profdata %t.profraw
> // RUN: llvm-cov show %t -instr-profile %t.profdata -filename-equivalence
> 2>&1 | FileCheck %s
> -//
> +// Testing PIE
> // RUN: %clang_profgen -fuse-ld=gold -O2 -fdata-sections
> -ffunction-sections -fPIE -pie -fprofile-instr-generate -fcoverage-mapping
> -Wl,--gc-sections -o %t.pie %s
> // RUN: env LLVM_PROFILE_FILE=%t.pie.profraw %run %t.pie
> // RUN: llvm-profdata merge -o %t.pie.profdata %t.pie.profraw
> // RUN: llvm-cov show %t.pie -instr-profile %t.pie.profdata
> -filename-equivalence 2>&1 | FileCheck %s
> +// testing m32
> +// RUN: %clang_profgen -fuse-ld=gold -O2 -fdata-sections
> -ffunction-sections -fPIE -pie -fprofile-instr-generate -fcoverage-mapping
> -m32 -Wl,--gc-sections -o %t.32.pie %s
> +// RUN: env LLVM_PROFILE_FILE=%t.32.pie.profraw %run %t.32.pie
> +// RUN: llvm-profdata merge -o %t.32.pie.profdata %t.32.pie.profraw
> +// RUN: llvm-cov show %t.32.pie -instr-profile %t.32.pie.profdata
> -filename-equivalence 2>&1 | FileCheck %s
>
> void foo(bool cond) { // CHECK: 1| [[@LINE]]|void foo(
> if (cond) { // CHECK: 1| [[@LINE]]| if (cond) {
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
--
Alexey Samsonov
vonosmas at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160210/68a662b7/attachment.html>
More information about the llvm-commits
mailing list