Ulrich Weigand | 9230997 | 2012-10-24 12:22:56 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple i386-unknown-unknown -fexceptions -emit-llvm -o - %s | FileCheck %s |
| 2 | // RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm -o - %s | FileCheck -check-prefix NOEXC %s |
Daniel Dunbar | 709c00c | 2008-08-11 18:40:47 +0000 | [diff] [blame] | 3 | |
John McCall | 39dad53 | 2010-08-03 22:46:07 +0000 | [diff] [blame] | 4 | int opaque(); |
| 5 | |
Bill Wendling | be9e8bf | 2013-02-28 22:49:57 +0000 | [diff] [blame] | 6 | // CHECK: define [[INT:i.*]] @test0() [[TF:#[0-9]+]] { |
Bill Wendling | c3af679 | 2013-02-26 23:08:48 +0000 | [diff] [blame] | 7 | // CHECK-NOEXC: define [[INT:i.*]] @test0() [[NUW:#[0-9]+]] { |
John McCall | 39dad53 | 2010-08-03 22:46:07 +0000 | [diff] [blame] | 8 | int test0(void) { |
| 9 | return opaque(); |
| 10 | } |
| 11 | |
| 12 | // <rdar://problem/8087431>: locally infer nounwind at -O0 |
Bill Wendling | c3af679 | 2013-02-26 23:08:48 +0000 | [diff] [blame] | 13 | // CHECK: define [[INT:i.*]] @test1() [[NUW:#[0-9]+]] { |
| 14 | // CHECK-NOEXC: define [[INT:i.*]] @test1() [[NUW]] { |
John McCall | 39dad53 | 2010-08-03 22:46:07 +0000 | [diff] [blame] | 15 | int test1(void) { |
John McCall | 03b0df9 | 2010-08-03 22:49:45 +0000 | [diff] [blame] | 16 | return 0; |
Daniel Dunbar | 709c00c | 2008-08-11 18:40:47 +0000 | [diff] [blame] | 17 | } |
John McCall | b3a29f1 | 2010-08-11 22:38:33 +0000 | [diff] [blame] | 18 | |
| 19 | // <rdar://problem/8283071>: not for weak functions |
Bill Wendling | be9e8bf | 2013-02-28 22:49:57 +0000 | [diff] [blame] | 20 | // CHECK: define weak [[INT:i.*]] @test2() [[TF]] { |
Bill Wendling | c3af679 | 2013-02-26 23:08:48 +0000 | [diff] [blame] | 21 | // CHECK-NOEXC: define weak [[INT:i.*]] @test2() [[NUW]] { |
John McCall | b3a29f1 | 2010-08-11 22:38:33 +0000 | [diff] [blame] | 22 | __attribute__((weak)) int test2(void) { |
| 23 | return 0; |
| 24 | } |
Bill Wendling | f7a9da0 | 2013-02-20 07:22:19 +0000 | [diff] [blame] | 25 | |
Bill Wendling | be9e8bf | 2013-02-28 22:49:57 +0000 | [diff] [blame] | 26 | // CHECK: attributes [[TF]] = { "{{.*}} } |
Bill Wendling | c3af679 | 2013-02-26 23:08:48 +0000 | [diff] [blame] | 27 | // CHECK: attributes [[NUW]] = { nounwind{{.*}} } |
Bill Wendling | f7a9da0 | 2013-02-20 07:22:19 +0000 | [diff] [blame] | 28 | |
Bill Wendling | c3af679 | 2013-02-26 23:08:48 +0000 | [diff] [blame] | 29 | // CHECK-NOEXC: attributes [[NUW]] = { nounwind{{.*}} } |