diff options
author | Mike Stump <mrs@apple.com> | 2009-07-25 21:26:53 +0000 |
---|---|---|
committer | Mike Stump <mrs@apple.com> | 2009-07-25 21:26:53 +0000 |
commit | 2455636163fdd18581d7fdae816433f886d88213 (patch) | |
tree | 400db92d5838683de2174dddb056f3a186d6c8cc /test | |
parent | 742cd1b7bb86b52b23b335d47abbd842dac0e1bf (diff) |
Add noreturn as a type attribute, handle printing for them and handle
calls to noreturn function pointers when CFG building.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77089 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGen/array.c | 4 | ||||
-rw-r--r-- | test/Sema/return.c | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/test/CodeGen/array.c b/test/CodeGen/array.c index 5bcc26ecf3..294dabfbbb 100644 --- a/test/CodeGen/array.c +++ b/test/CodeGen/array.c @@ -1,11 +1,11 @@ // RUN: clang-cc -emit-llvm %s -o %t -int f() { +void f() { int a[2]; a[0] = 0; } -int f2() { +void f2() { int x = 0; int y = 1; int a[10] = { y, x, 2, 3}; diff --git a/test/Sema/return.c b/test/Sema/return.c index fd50d0792a..db83a06d2a 100644 --- a/test/Sema/return.c +++ b/test/Sema/return.c @@ -158,6 +158,7 @@ int test26() { } // expected-warning {{control reaches end of non-void function}} int j; +void (*fptr)() __attribute__((noreturn)); int test27() { switch (j) { case 1: @@ -178,6 +179,9 @@ int test27() { case 5: while (1) { return 1; } break; + case 6: + fptr(); + break; default: return 1; } |