diff options
author | Rong Xu <xur@google.com> | 2016-02-04 18:39:09 +0000 |
---|---|---|
committer | Rong Xu <xur@google.com> | 2016-02-04 18:39:09 +0000 |
commit | bf1d31e84aa2722174da56b8aff311ae04f4d9e1 (patch) | |
tree | 136ff89e0fab737006c3fb7bcf8387655ba03eca /test/Profile | |
parent | 67e7611e1ae0b3cccaaaa0f22c2185abac5d956e (diff) |
[PGO] cc1 option name change for profile instrumentation
This patch changes cc1 option -fprofile-instr-generate to an enum option
-fprofile-instrument={clang|none}. It also changes cc1 options
-fprofile-instr-generate= to -fprofile-instrument-path=.
The driver level option -fprofile-instr-generate and -fprofile-instr-generate=
remain intact. This change will pave the way to integrate new PGO
instrumentation in IR level.
Review: http://reviews.llvm.org/D16730
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259811 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Profile')
-rw-r--r-- | test/Profile/c-captured.c | 2 | ||||
-rw-r--r-- | test/Profile/c-general.c | 2 | ||||
-rw-r--r-- | test/Profile/c-generate.c | 17 | ||||
-rw-r--r-- | test/Profile/c-indirect-call.c | 2 | ||||
-rw-r--r-- | test/Profile/c-linkage-available_externally.c | 2 | ||||
-rw-r--r-- | test/Profile/c-linkage.c | 2 | ||||
-rw-r--r-- | test/Profile/c-unreachable-after-switch.c | 2 | ||||
-rw-r--r-- | test/Profile/cxx-implicit.cpp | 2 | ||||
-rw-r--r-- | test/Profile/cxx-lambda.cpp | 2 | ||||
-rw-r--r-- | test/Profile/cxx-linkage.cpp | 2 | ||||
-rw-r--r-- | test/Profile/cxx-rangefor.cpp | 2 | ||||
-rw-r--r-- | test/Profile/cxx-structors.cpp | 2 | ||||
-rw-r--r-- | test/Profile/cxx-templates.cpp | 2 | ||||
-rw-r--r-- | test/Profile/cxx-virtual-destructor-calls.cpp | 2 | ||||
-rw-r--r-- | test/Profile/objc-general.m | 2 |
15 files changed, 25 insertions, 20 deletions
diff --git a/test/Profile/c-captured.c b/test/Profile/c-captured.c index e859628eab..1424fbb7f0 100644 --- a/test/Profile/c-captured.c +++ b/test/Profile/c-captured.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-captured.c %s -o - -emit-llvm -fprofile-instr-generate | FileCheck -check-prefix=PGOGEN -check-prefix=PGOALL %s +// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-captured.c %s -o - -emit-llvm -fprofile-instrument=clang | FileCheck -check-prefix=PGOGEN -check-prefix=PGOALL %s // RUN: llvm-profdata merge %S/Inputs/c-captured.proftext -o %t.profdata // RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-captured.c %s -o - -emit-llvm -fprofile-instr-use=%t.profdata | FileCheck -check-prefix=PGOUSE -check-prefix=PGOALL %s diff --git a/test/Profile/c-general.c b/test/Profile/c-general.c index 03631d8c7c..a633b141e4 100644 --- a/test/Profile/c-general.c +++ b/test/Profile/c-general.c @@ -1,6 +1,6 @@ // Test instrumentation of general constructs in C. -// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-general.c %s -o - -emit-llvm -fprofile-instr-generate | FileCheck -check-prefix=PGOGEN %s +// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-general.c %s -o - -emit-llvm -fprofile-instrument=clang | FileCheck -check-prefix=PGOGEN %s // RUN: llvm-profdata merge %S/Inputs/c-general.proftext -o %t.profdata // RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-general.c %s -o - -emit-llvm -fprofile-instr-use=%t.profdata | FileCheck -check-prefix=PGOUSE %s diff --git a/test/Profile/c-generate.c b/test/Profile/c-generate.c index 8be4e28477..454f5dbf59 100644 --- a/test/Profile/c-generate.c +++ b/test/Profile/c-generate.c @@ -1,9 +1,14 @@ -// Check that the -fprofile-instr-generate= form works. -// RUN: %clang_cc1 -main-file-name c-generate.c %s -o - -emit-llvm -fprofile-instr-generate=c-generate-test.profraw | FileCheck %s - -// CHECK: private constant [24 x i8] c"c-generate-test.profraw\00" -// CHECK: call void @__llvm_profile_override_default_filename(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @0, i32 0, i32 0)) -// CHECK: declare void @__llvm_profile_override_default_filename(i8*) +// Check that the -fprofile-instrument-path= form works. +// RUN: %clang_cc1 -main-file-name c-generate.c %s -o - -emit-llvm -fprofile-instrument=clang -fprofile-instrument-path=c-generate-test.profraw | FileCheck %s --check-prefix=PROF-INSTR-PATH +// RUN: %clang_cc1 %s -o - -emit-llvm -fprofile-instrument=none | FileCheck %s --check-prefix=PROF-INSTR-NONE +// RUN: not %clang_cc1 %s -o - -emit-llvm -fprofile-instrument=garbage 2>&1 | FileCheck %s --check-prefix=PROF-INSTR-GARBAGE +// +// PROF-INSTR-PATH: private constant [24 x i8] c"c-generate-test.profraw\00" +// PROF-INSTR-PATH: call void @__llvm_profile_override_default_filename(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @0, i32 0, i32 0)) +// PROF-INSTR-PATH: declare void @__llvm_profile_override_default_filename(i8*) +// +// PROF-INSTR-NONE-NOT: @__profn_main +// PROF-INSTR-GARBAGE: invalid PGO instrumentor in argument '-fprofile-instrument=garbage' int main(void) { return 0; diff --git a/test/Profile/c-indirect-call.c b/test/Profile/c-indirect-call.c index d73d09a9a1..ab66c58954 100644 --- a/test/Profile/c-indirect-call.c +++ b/test/Profile/c-indirect-call.c @@ -1,5 +1,5 @@ // Check the data structures emitted by instrumentation. -// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-indirect-call.c %s -o - -emit-llvm -fprofile-instr-generate -mllvm -enable-value-profiling | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-indirect-call.c %s -o - -emit-llvm -fprofile-instrument=clang -mllvm -enable-value-profiling | FileCheck %s void (*foo)(void); diff --git a/test/Profile/c-linkage-available_externally.c b/test/Profile/c-linkage-available_externally.c index 61a258636b..8907839cb9 100644 --- a/test/Profile/c-linkage-available_externally.c +++ b/test/Profile/c-linkage-available_externally.c @@ -1,6 +1,6 @@ // Make sure instrumentation data from available_externally functions doesn't // get thrown out and are emitted with the expected linkage. -// RUN: %clang_cc1 -O2 -triple x86_64-apple-macosx10.9 -main-file-name c-linkage-available_externally.c %s -o - -emit-llvm -fprofile-instr-generate | FileCheck %s +// RUN: %clang_cc1 -O2 -triple x86_64-apple-macosx10.9 -main-file-name c-linkage-available_externally.c %s -o - -emit-llvm -fprofile-instrument=clang | FileCheck %s // CHECK: @__profc_foo = linkonce_odr hidden global [1 x i64] zeroinitializer, section "__DATA,__llvm_prf_cnts", align 8 // CHECK: @__profd_foo = linkonce_odr hidden global {{.*}} i64* getelementptr inbounds ([1 x i64], [1 x i64]* @__profc_foo, i32 0, i32 0){{.*}}, section "__DATA,__llvm_prf_data", align 8 diff --git a/test/Profile/c-linkage.c b/test/Profile/c-linkage.c index c82dcabb60..50ac558fb0 100644 --- a/test/Profile/c-linkage.c +++ b/test/Profile/c-linkage.c @@ -1,5 +1,5 @@ // Check that the profiling counters and data we create have the linkage we expect -// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-linkage.c %s -o - -emit-llvm -fprofile-instr-generate | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-linkage.c %s -o - -emit-llvm -fprofile-instrument=clang | FileCheck %s // CHECK: @__profc_foo = private global // CHECK: @__profd_foo = private global diff --git a/test/Profile/c-unreachable-after-switch.c b/test/Profile/c-unreachable-after-switch.c index 7d1855db18..36a75449db 100644 --- a/test/Profile/c-unreachable-after-switch.c +++ b/test/Profile/c-unreachable-after-switch.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -O3 -triple x86_64-apple-macosx10.10 -main-file-name c-unreachable-after-switch.c %s -o - -emit-llvm -fprofile-instr-generate | FileCheck %s +// RUN: %clang_cc1 -O3 -triple x86_64-apple-macosx10.10 -main-file-name c-unreachable-after-switch.c %s -o - -emit-llvm -fprofile-instrument=clang | FileCheck %s // CHECK: @[[C:__profc_foo]] = private global [3 x i64] zeroinitializer diff --git a/test/Profile/cxx-implicit.cpp b/test/Profile/cxx-implicit.cpp index b25486ae4c..47e5b8de04 100644 --- a/test/Profile/cxx-implicit.cpp +++ b/test/Profile/cxx-implicit.cpp @@ -1,6 +1,6 @@ // Ensure that implicit methods aren't instrumented. -// RUN: %clang_cc1 -x c++ %s -triple %itanium_abi_triple -main-file-name cxx-implicit.cpp -o - -emit-llvm -fprofile-instr-generate | FileCheck %s +// RUN: %clang_cc1 -x c++ %s -triple %itanium_abi_triple -main-file-name cxx-implicit.cpp -o - -emit-llvm -fprofile-instrument=clang | FileCheck %s // An implicit constructor is generated for Base. We should not emit counters // for it. diff --git a/test/Profile/cxx-lambda.cpp b/test/Profile/cxx-lambda.cpp index 26314c892e..b2bcbd25f1 100644 --- a/test/Profile/cxx-lambda.cpp +++ b/test/Profile/cxx-lambda.cpp @@ -1,6 +1,6 @@ // Tests for instrumentation of C++11 lambdas -// RUN: %clang_cc1 -x c++ %s -triple %itanium_abi_triple -main-file-name cxx-lambda.cpp -std=c++11 -o - -emit-llvm -fprofile-instr-generate > %tgen +// RUN: %clang_cc1 -x c++ %s -triple %itanium_abi_triple -main-file-name cxx-lambda.cpp -std=c++11 -o - -emit-llvm -fprofile-instrument=clang > %tgen // RUN: FileCheck --input-file=%tgen -check-prefix=PGOGEN %s // RUN: FileCheck --input-file=%tgen -check-prefix=LMBGEN %s diff --git a/test/Profile/cxx-linkage.cpp b/test/Profile/cxx-linkage.cpp index 55934037ba..6f7b2b7128 100644 --- a/test/Profile/cxx-linkage.cpp +++ b/test/Profile/cxx-linkage.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9.0 -emit-llvm -main-file-name cxx-linkage.cpp %s -o - -fprofile-instr-generate | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9.0 -emit-llvm -main-file-name cxx-linkage.cpp %s -o - -fprofile-instrument=clang | FileCheck %s // CHECK: @__profc__Z3foov = private global // CHECK: @__profd__Z3foov = private global diff --git a/test/Profile/cxx-rangefor.cpp b/test/Profile/cxx-rangefor.cpp index 1007a70775..253e52d864 100644 --- a/test/Profile/cxx-rangefor.cpp +++ b/test/Profile/cxx-rangefor.cpp @@ -1,6 +1,6 @@ // Tests for instrumentation of C++11 range-for -// RUN: %clang_cc1 -x c++ %s -triple %itanium_abi_triple -main-file-name cxx-rangefor.cpp -std=c++11 -o - -emit-llvm -fprofile-instr-generate > %tgen +// RUN: %clang_cc1 -x c++ %s -triple %itanium_abi_triple -main-file-name cxx-rangefor.cpp -std=c++11 -o - -emit-llvm -fprofile-instrument=clang > %tgen // RUN: FileCheck --input-file=%tgen -check-prefix=CHECK -check-prefix=PGOGEN %s // RUN: llvm-profdata merge %S/Inputs/cxx-rangefor.proftext -o %t.profdata diff --git a/test/Profile/cxx-structors.cpp b/test/Profile/cxx-structors.cpp index 183df92257..73562d39c9 100644 --- a/test/Profile/cxx-structors.cpp +++ b/test/Profile/cxx-structors.cpp @@ -1,6 +1,6 @@ // Tests for instrumentation of C++ constructors and destructors. // -// RUN: %clang_cc1 -triple x86_64-apple-macosx10.11.0 -x c++ %s -o - -emit-llvm -fprofile-instr-generate | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-apple-macosx10.11.0 -x c++ %s -o - -emit-llvm -fprofile-instrument=clang | FileCheck %s struct Foo { Foo() {} diff --git a/test/Profile/cxx-templates.cpp b/test/Profile/cxx-templates.cpp index c24bae39c3..65c4626fb3 100644 --- a/test/Profile/cxx-templates.cpp +++ b/test/Profile/cxx-templates.cpp @@ -1,7 +1,7 @@ // Tests for instrumentation of templated code. Each instantiation of a template // should be instrumented separately. -// RUN: %clang_cc1 -x c++ %s -triple %itanium_abi_triple -main-file-name cxx-templates.cpp -std=c++11 -o - -emit-llvm -fprofile-instr-generate > %tgen +// RUN: %clang_cc1 -x c++ %s -triple %itanium_abi_triple -main-file-name cxx-templates.cpp -std=c++11 -o - -emit-llvm -fprofile-instrument=clang > %tgen // RUN: FileCheck --input-file=%tgen -check-prefix=T0GEN -check-prefix=ALL %s // RUN: FileCheck --input-file=%tgen -check-prefix=T100GEN -check-prefix=ALL %s diff --git a/test/Profile/cxx-virtual-destructor-calls.cpp b/test/Profile/cxx-virtual-destructor-calls.cpp index 4affd2618e..cc3df68d35 100644 --- a/test/Profile/cxx-virtual-destructor-calls.cpp +++ b/test/Profile/cxx-virtual-destructor-calls.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -main-file-name cxx-virtual-destructor-calls.cpp %s -o - -fprofile-instr-generate | FileCheck %s +// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -main-file-name cxx-virtual-destructor-calls.cpp %s -o - -fprofile-instrument=clang | FileCheck %s struct Member { ~Member(); diff --git a/test/Profile/objc-general.m b/test/Profile/objc-general.m index b6435af78b..ba3006551a 100644 --- a/test/Profile/objc-general.m +++ b/test/Profile/objc-general.m @@ -1,6 +1,6 @@ // Test instrumentation of general constructs in objective C. -// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name objc-general.m %s -o - -emit-llvm -fblocks -fprofile-instr-generate | FileCheck -check-prefix=PGOGEN %s +// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name objc-general.m %s -o - -emit-llvm -fblocks -fprofile-instrument=clang | FileCheck -check-prefix=PGOGEN %s // RUN: llvm-profdata merge %S/Inputs/objc-general.proftext -o %t.profdata // RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name objc-general.m %s -o - -emit-llvm -fblocks -fprofile-instr-use=%t.profdata | FileCheck -check-prefix=PGOUSE %s |