r199863 - test/CodeGenCXX: Give instr-profile exception tests their own file

Justin Bogner mail at justinbogner.com
Wed Jan 22 18:54:23 PST 2014


Author: bogner
Date: Wed Jan 22 20:54:23 2014
New Revision: 199863

URL: http://llvm.org/viewvc/llvm-project?rev=199863&view=rev
Log:
test/CodeGenCXX: Give instr-profile exception tests their own file

This test requires asserts for now, and exception handling has an
awkward structure that leads to extra run lines. Because of this, the
test file's not a great place for other C++ PGO tests, but
instr-profile.cpp is obviously the better name for them.

Added:
    cfe/trunk/test/CodeGenCXX/Inputs/instr-profile-throws.pgodata
      - copied, changed from r199862, cfe/trunk/test/CodeGenCXX/Inputs/instr-profile.pgodata
    cfe/trunk/test/CodeGenCXX/instr-profile-throws.cpp
      - copied, changed from r199862, cfe/trunk/test/CodeGenCXX/instr-profile.cpp
Removed:
    cfe/trunk/test/CodeGenCXX/Inputs/instr-profile.pgodata
    cfe/trunk/test/CodeGenCXX/instr-profile.cpp

Copied: cfe/trunk/test/CodeGenCXX/Inputs/instr-profile-throws.pgodata (from r199862, cfe/trunk/test/CodeGenCXX/Inputs/instr-profile.pgodata)
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/Inputs/instr-profile-throws.pgodata?p2=cfe/trunk/test/CodeGenCXX/Inputs/instr-profile-throws.pgodata&p1=cfe/trunk/test/CodeGenCXX/Inputs/instr-profile.pgodata&r1=199862&r2=199863&rev=199863&view=diff
==============================================================================
    (empty)

Removed: cfe/trunk/test/CodeGenCXX/Inputs/instr-profile.pgodata
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/Inputs/instr-profile.pgodata?rev=199862&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenCXX/Inputs/instr-profile.pgodata (original)
+++ cfe/trunk/test/CodeGenCXX/Inputs/instr-profile.pgodata (removed)
@@ -1,16 +0,0 @@
-_Z6throwsv 11
-1
-100
-0
-0
-100
-66
-33
-17
-50
-33
-100
-
-main 1
-1
-

Copied: cfe/trunk/test/CodeGenCXX/instr-profile-throws.cpp (from r199862, cfe/trunk/test/CodeGenCXX/instr-profile.cpp)
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/instr-profile-throws.cpp?p2=cfe/trunk/test/CodeGenCXX/instr-profile-throws.cpp&p1=cfe/trunk/test/CodeGenCXX/instr-profile.cpp&r1=199862&r2=199863&rev=199863&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/instr-profile.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/instr-profile-throws.cpp Wed Jan 22 20:54:23 2014
@@ -10,8 +10,8 @@
 // RUN: %clangxx %s -o - -emit-llvm -S -fprofile-instr-generate -target %itanium_abi_triple | FileCheck -check-prefix=PGOGEN %s
 // RUN: %clangxx %s -o - -emit-llvm -S -fprofile-instr-generate -target %itanium_abi_triple | FileCheck -check-prefix=PGOGEN-EXC %s
 
-// RUN: %clang %s -o - -emit-llvm -S -fprofile-instr-use=%S/Inputs/instr-profile.pgodata -target %itanium_abi_triple | FileCheck -check-prefix=PGOUSE %s
-// RUN: %clang %s -o - -emit-llvm -S -fprofile-instr-use=%S/Inputs/instr-profile.pgodata -target %itanium_abi_triple | FileCheck -check-prefix=PGOUSE-EXC %s
+// RUN: %clang %s -o - -emit-llvm -S -fprofile-instr-use=%S/Inputs/instr-profile-throws.pgodata -target %itanium_abi_triple | FileCheck -check-prefix=PGOUSE %s
+// RUN: %clang %s -o - -emit-llvm -S -fprofile-instr-use=%S/Inputs/instr-profile-throws.pgodata -target %itanium_abi_triple | FileCheck -check-prefix=PGOUSE-EXC %s
 
 // PGOGEN: @[[THC:__llvm_pgo_ctr[0-9]*]] = private global [11 x i64] zeroinitializer
 // PGOGEN-EXC: @[[THC:__llvm_pgo_ctr[0-9]*]] = private global [11 x i64] zeroinitializer

Removed: cfe/trunk/test/CodeGenCXX/instr-profile.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/instr-profile.cpp?rev=199862&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenCXX/instr-profile.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/instr-profile.cpp (removed)
@@ -1,76 +0,0 @@
-// Test that instrumentation based profiling feeds branch prediction
-// correctly. This tests both generation of profile data and use of the same,
-// and the input file for the -fprofile-instr-use case is expected to be result
-// of running the program generated by the -fprofile-instr-generate case. As
-// such, main() should call every function in this test.
-
-// FIXME: Don't seek bb labels, like "if.else"
-// REQUIRES: asserts
-
-// RUN: %clangxx %s -o - -emit-llvm -S -fprofile-instr-generate -target %itanium_abi_triple | FileCheck -check-prefix=PGOGEN %s
-// RUN: %clangxx %s -o - -emit-llvm -S -fprofile-instr-generate -target %itanium_abi_triple | FileCheck -check-prefix=PGOGEN-EXC %s
-
-// RUN: %clang %s -o - -emit-llvm -S -fprofile-instr-use=%S/Inputs/instr-profile.pgodata -target %itanium_abi_triple | FileCheck -check-prefix=PGOUSE %s
-// RUN: %clang %s -o - -emit-llvm -S -fprofile-instr-use=%S/Inputs/instr-profile.pgodata -target %itanium_abi_triple | FileCheck -check-prefix=PGOUSE-EXC %s
-
-// PGOGEN: @[[THC:__llvm_pgo_ctr[0-9]*]] = private global [11 x i64] zeroinitializer
-// PGOGEN-EXC: @[[THC:__llvm_pgo_ctr[0-9]*]] = private global [11 x i64] zeroinitializer
-
-// PGOGEN-LABEL: @_Z6throwsv()
-// PGOUSE-LABEL: @_Z6throwsv()
-// PGOGEN: store {{.*}} @[[THC]], i64 0, i64 0
-void throws() {
-  // PGOGEN: store {{.*}} @[[THC]], i64 0, i64 1
-  // PGOUSE: br {{.*}} !prof ![[TH1:[0-9]+]]
-  for (int i = 0; i < 100; ++i) {
-    try {
-      // PGOGEN: store {{.*}} @[[THC]], i64 0, i64 5
-      // PGOUSE: br {{.*}} !prof ![[TH2:[0-9]+]]
-      if (i % 3) {
-        // PGOGEN: store {{.*}} @[[THC]], i64 0, i64 6
-        // PGOUSE: br {{.*}} !prof ![[TH3:[0-9]+]]
-        if (i < 50)
-          throw 1;
-      } else {
-        // The catch block may be emitted after the throw above, we can skip it
-        // by looking for an else block, but this will break if anyone puts an
-        // else in the catch
-        // PGOUSE: if.else{{.*}}:
-        // PGOGEN: if.else{{.*}}:
-
-        // PGOGEN: store {{.*}} @[[THC]], i64 0, i64 7
-        // PGOUSE: br {{.*}} !prof ![[TH4:[0-9]+]]
-        if (i >= 50)
-          throw 0;
-      }
-    } catch (int e) {
-      // PGOUSE-EXC: catch{{.*}}:
-      // PGOGEN-EXC: catch{{.*}}:
-
-      // PGOGEN-EXC: store {{.*}} @[[THC]], i64 0, i64 8
-      // PGOGEN-EXC: store {{.*}} @[[THC]], i64 0, i64 9
-      // PGOUSE-EXC: br {{.*}} !prof ![[TH5:[0-9]+]]
-      if (e) {}
-    }
-    // PGOGEN: store {{.*}} @[[THC]], i64 0, i64 4
-
-    // PGOGEN: store {{.*}} @[[THC]], i64 0, i64 10
-    // PGOUSE: br {{.*}} !prof ![[TH6:[0-9]+]]
-    if (i < 100) {}
-  }
-
-  // PGOUSE-NOT: br {{.*}} !prof ![0-9]+
-  // PGOUSE: ret void
-}
-
-// PGOUSE-DAG: ![[TH1]] = metadata !{metadata !"branch_weights", i32 101, i32 2}
-// PGOUSE-DAG: ![[TH2]] = metadata !{metadata !"branch_weights", i32 67, i32 35}
-// PGOUSE-DAG: ![[TH3]] = metadata !{metadata !"branch_weights", i32 34, i32 34}
-// PGOUSE-DAG: ![[TH4]] = metadata !{metadata !"branch_weights", i32 18, i32 18}
-// PGOUSE-EXC: ![[TH5]] = metadata !{metadata !"branch_weights", i32 34, i32 18}
-// PGOUSE-DAG: ![[TH6]] = metadata !{metadata !"branch_weights", i32 101, i32 1}
-
-int main(int argc, const char *argv[]) {
-  throws();
-  return 0;
-}





More information about the cfe-commits mailing list