diff options
author | John McCall <rjmccall@apple.com> | 2010-08-01 00:26:45 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-08-01 00:26:45 +0000 |
commit | b60a77e453d32db0ab1914d28e175c2defc0eb65 (patch) | |
tree | 96a5010a106877369b4b5e4ac4973a2fe1fd9c4b /test/CodeGen/statements.c | |
parent | 64a15230a9e0e030bd761c6848a5876354653ded (diff) | |
download | clang-b60a77e453d32db0ab1914d28e175c2defc0eb65.tar.gz |
Only run the jump-checker if there's a branch-protected scope *and* there's
a switch or goto somewhere in the function. Indirect gotos trigger the
jump-checker regardless, because the conditions there are slightly more
elaborate and it's too marginal a case to be worth optimizing.
Turns off the jump-checker in a lot of cases in C++. rdar://problem/7702918
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109962 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/statements.c')
-rw-r--r-- | test/CodeGen/statements.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/test/CodeGen/statements.c b/test/CodeGen/statements.c index 7ed82add69..76983cc493 100644 --- a/test/CodeGen/statements.c +++ b/test/CodeGen/statements.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -Wreturn-type < %s -emit-llvm +// RUN: %clang_cc1 -Wreturn-type %s -emit-llvm void test1(int x) { switch (x) { @@ -31,5 +31,10 @@ static long y = &&baz; } // PR3869 -int test5(long long b) { goto *b; } +int test5(long long b) { + static void *lbls[] = { &&lbl }; + goto *b; + lbl: + return 0; +} |