summaryrefslogtreecommitdiffstats
path: root/clang/test/Profile/cxx-stmt-initializers.cpp
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2016-10-14 23:38:16 +0000
committerVedant Kumar <vsk@apple.com>2016-10-14 23:38:16 +0000
commit9d2a16b9b19bb3c63f7cba894fa1043b1487768d (patch)
tree77a1276e0a955cfb0ef55c6daba36525f6b161ce /clang/test/Profile/cxx-stmt-initializers.cpp
parentf2a6ec55215dbbbadcc78a0e091c1cfda611cdef (diff)
downloadbcm5719-llvm-9d2a16b9b19bb3c63f7cba894fa1043b1487768d.tar.gz
bcm5719-llvm-9d2a16b9b19bb3c63f7cba894fa1043b1487768d.zip
[Coverage] Support for C++17 if initializers
Differential Revision: https://reviews.llvm.org/D25572 llvm-svn: 284293
Diffstat (limited to 'clang/test/Profile/cxx-stmt-initializers.cpp')
-rw-r--r--clang/test/Profile/cxx-stmt-initializers.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/Profile/cxx-stmt-initializers.cpp b/clang/test/Profile/cxx-stmt-initializers.cpp
index 0e3d54449ab..44f7edd276f 100644
--- a/clang/test/Profile/cxx-stmt-initializers.cpp
+++ b/clang/test/Profile/cxx-stmt-initializers.cpp
@@ -4,6 +4,7 @@
// RUN: FileCheck --input-file=%tgen -check-prefix=CHECK -check-prefix=PGOGEN %s
// PGOGEN: @[[SIC:__profc__Z11switch_initv]] = private global [3 x i64] zeroinitializer
+// PGOGEN: @[[IIC:__profc__Z7if_initv]] = private global [3 x i64] zeroinitializer
// Note: We expect counters for the function entry block, the condition in the
// switch initializer, and the switch successor block.
@@ -15,3 +16,14 @@ void switch_init() {
// PGOGEN: store {{.*}} @[[SIC]], i64 0, i64 2
// PGOGEN: store {{.*}} @[[SIC]], i64 0, i64 1
}
+
+// Note: We expect counters for the function entry block, the condition in the
+// if initializer, and the if successor block.
+//
+// CHECK-LABEL: define {{.*}}void @_Z7if_initv()
+// PGOGEN: store {{.*}} @[[IIC]], i64 0, i64 0
+void if_init() {
+ if (int i = true ? 0 : 1; i) {}
+ // PGOGEN: store {{.*}} @[[IIC]], i64 0, i64 2
+ // PGOGEN: store {{.*}} @[[IIC]], i64 0, i64 1
+}
OpenPOWER on IntegriCloud