From: Bob Wilson Date: Fri, 28 Feb 2014 05:57:14 +0000 (+0000) Subject: Add a testcase for r202437. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2cedba8699feb5ed96ee496a4e5c6a7cd58d4094;p=clang Add a testcase for r202437. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202468 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CodeGen/Inputs/instr-profile.pgodata b/test/CodeGen/Inputs/instr-profile.pgodata index 1a445ed7e8..07e763ed1d 100644 --- a/test/CodeGen/Inputs/instr-profile.pgodata +++ b/test/CodeGen/Inputs/instr-profile.pgodata @@ -116,6 +116,12 @@ boolop_loops 9 50 26 +do_fallthrough 4 +1 +10 +2 +8 + no_usable_data 5 1 1 diff --git a/test/CodeGen/instr-profile.c b/test/CodeGen/instr-profile.c index b5062f4c90..c982dcb758 100644 --- a/test/CodeGen/instr-profile.c +++ b/test/CodeGen/instr-profile.c @@ -417,6 +417,19 @@ void boolop_loops() { // PGOUSE-NOT: br {{.*}} !prof ![0-9]+ } +void do_fallthrough() { + for (int i = 0; i < 10; ++i) { + int j = 0; + do { + // The number of exits out of this do-loop via the break statement + // exceeds the counter value for the loop (which does not include the + // fallthrough count). Make sure that does not violate any assertions. + if (i < 8) break; + j++; + } while (j < 2); + } +} + // PGOGEN-LABEL: @no_usable_data() // PGOUSE-LABEL: @no_usable_data() // PGOGEN: store {{.*}} @[[NOC]], i64 0, i64 0 @@ -510,6 +523,7 @@ int main(int argc, const char *argv[]) { big_switch(); boolean_operators(); boolop_loops(); + do_fallthrough(); no_usable_data(); return 0; }