+++ /dev/null
-instr-profile.m:__13+[A foreach:]_block_invoke 2
-2
-1
-
-instr-profile.m:+[A foreach:] 2
-1
-2
-
-main 1
-1
-
main 1
1
-instr-profile.c:static_func 2
+c-general.c:static_func 2
1
10
--- /dev/null
+objc-general.m:__13+[A foreach:]_block_invoke 2
+2
+1
+
+objc-general.m:+[A foreach:] 2
+1
+2
+
+main 1
+1
--- /dev/null
+These are tests for instrumentation based profiling. This specifically
+means the -fprofile-instr-generate and -fprofile-instr-use driver flags.
+
+Tests in this directory should test both the generation of profile
+data, and the use of that same data. As such, the input source file
+should include a main function such that building with -use and
+running the resulting program would generate the input data that is
+consumed in the -generate case.
// Test that instrumentation based profiling sets function attributes correctly.
-// RUN: %clang %s -o - -mllvm -disable-llvm-optzns -emit-llvm -S -fprofile-instr-use=%S/Inputs/instr-attribute.profdata | FileCheck %s
+// RUN: %clang %s -o - -mllvm -disable-llvm-optzns -emit-llvm -S -fprofile-instr-use=%S/Inputs/c-attributes.profdata | FileCheck %s
extern int atoi(const char *);
-// 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
-// (excepting no_usable_data). As such, main() should call every function in
-// this test.
-
-// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name instr-profile.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 instr-profile.c %s -o - -emit-llvm -fprofile-instr-use=%S/Inputs/instr-profile.profdata | FileCheck -check-prefix=PGOUSE %s
+// 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-instr-use=%S/Inputs/c-general.profdata | FileCheck -check-prefix=PGOUSE %s
// PGOGEN: @[[SLC:__llvm_pgo_ctr[0-9]*]] = private global [4 x i64] zeroinitializer
// PGOGEN: @[[IFC:__llvm_pgo_ctr[0-9]*]] = private global [11 x i64] zeroinitializer
-// 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
-// (excepting no_usable_data). As such, main() should call every function in
-// this test.
+// Tests for instrumentation of C++ methods, constructors, and destructors.
// RUN: %clang %s -o - -emit-llvm -S -fprofile-instr-generate -fno-exceptions -target %itanium_abi_triple > %tgen
// RUN: FileCheck --input-file=%tgen -check-prefix=CTRGEN %s
// RUN: FileCheck --input-file=%tgen -check-prefix=MTHGEN %s
// RUN: FileCheck --input-file=%tgen -check-prefix=WRPGEN %s
-// RUN: %clang %s -o - -emit-llvm -S -fprofile-instr-use=%S/Inputs/instr-profile-class.profdata -fno-exceptions -target %itanium_abi_triple > %tuse
+// RUN: %clang %s -o - -emit-llvm -S -fprofile-instr-use=%S/Inputs/cxx-class.profdata -fno-exceptions -target %itanium_abi_triple > %tuse
// RUN: FileCheck --input-file=%tuse -check-prefix=CTRUSE %s
// RUN: FileCheck --input-file=%tuse -check-prefix=DTRUSE %s
// RUN: FileCheck --input-file=%tuse -check-prefix=MTHUSE %s
-// 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.
+// Test instrumentation of C++ exception handling constructs.
// 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-throws.profdata -target %itanium_abi_triple | FileCheck -check-prefix=PGOUSE %s
-// RUN: %clang %s -o - -emit-llvm -S -fprofile-instr-use=%S/Inputs/instr-profile-throws.profdata -target %itanium_abi_triple | FileCheck -check-prefix=PGOUSE-EXC %s
+// RUN: %clang %s -o - -emit-llvm -S -fprofile-instr-use=%S/Inputs/cxx-throws.profdata -target %itanium_abi_triple | FileCheck -check-prefix=PGOUSE %s
+// RUN: %clang %s -o - -emit-llvm -S -fprofile-instr-use=%S/Inputs/cxx-throws.profdata -target %itanium_abi_triple | FileCheck -check-prefix=PGOUSE-EXC %s
// PGOGEN: @[[THC:__llvm_pgo_ctr[0-9]*]] = private global [9 x i64] zeroinitializer
// PGOGEN-EXC: @[[THC:__llvm_pgo_ctr[0-9]*]] = private global [9 x i64] zeroinitializer
-// 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.
+// Test instrumentation of general constructs in objective C.
-// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name instr-profile.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 instr-profile.m %s -o - -emit-llvm -fblocks -fprofile-instr-use=%S/Inputs/instr-profile.profdata | FileCheck -check-prefix=PGOUSE %s
+// 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-instr-use=%S/Inputs/objc-general.profdata | FileCheck -check-prefix=PGOUSE %s
#ifdef HAVE_FOUNDATION