diff options
| author | John McCall <rjmccall@apple.com> | 2010-08-03 22:46:07 +0000 |
|---|---|---|
| committer | John McCall <rjmccall@apple.com> | 2010-08-03 22:46:07 +0000 |
| commit | 8601a7511869e0f91f16c60a45e07bca9b5b8593 (patch) | |
| tree | c8cead7cc686b4f95ea8a5e7e32cddbe38226d91 /clang/test/CodeGen | |
| parent | 38321174e09cde27318cf58f6b08e5bd7c92144c (diff) | |
| download | bcm5719-llvm-8601a7511869e0f91f16c60a45e07bca9b5b8593.tar.gz bcm5719-llvm-8601a7511869e0f91f16c60a45e07bca9b5b8593.zip | |
Do a very simple pass over every function we emit to infer whether we can
mark it nounwind based on whether it contains any non-nounwind calls.
<rdar://problem/8087431>
llvm-svn: 110163
Diffstat (limited to 'clang/test/CodeGen')
| -rw-r--r-- | clang/test/CodeGen/unwind-attr.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/clang/test/CodeGen/unwind-attr.c b/clang/test/CodeGen/unwind-attr.c index ee3199d274d..7b34ae207e1 100644 --- a/clang/test/CodeGen/unwind-attr.c +++ b/clang/test/CodeGen/unwind-attr.c @@ -1,6 +1,16 @@ -// RUN: %clang_cc1 -fexceptions -emit-llvm -o - %s | grep "@foo()" | not grep nounwind -// RUN: %clang_cc1 -emit-llvm -o - %s | grep "@foo()" | grep nounwind +// RUN: %clang_cc1 -fexceptions -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck -check-prefix NOEXC %s -int foo(void) { - return 0; +int opaque(); + +// CHECK: define [[INT:i.*]] @test0() { +// CHECK-NOEXC: define [[INT:i.*]] @test0() nounwind { +int test0(void) { + return opaque(); +} + +// <rdar://problem/8087431>: locally infer nounwind at -O0 +// CHECK: define [[INT:i.*]] @test1() nounwind { +// CHECK-NOEXC: define [[INT:i.*]] @test1() nounwind { +int test1(void) { } |

