2012-10-24 20:22:56 +08:00
|
|
|
// RUN: %clang_cc1 -triple i386-unknown-unknown -fexceptions -emit-llvm -o - %s | FileCheck %s
|
|
|
|
// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm -o - %s | FileCheck -check-prefix NOEXC %s
|
2008-08-12 02:40:47 +08:00
|
|
|
|
2010-08-04 06:46:07 +08:00
|
|
|
int opaque();
|
|
|
|
|
2013-03-01 06:49:57 +08:00
|
|
|
// CHECK: define [[INT:i.*]] @test0() [[TF:#[0-9]+]] {
|
2013-02-27 07:08:48 +08:00
|
|
|
// CHECK-NOEXC: define [[INT:i.*]] @test0() [[NUW:#[0-9]+]] {
|
2010-08-04 06:46:07 +08:00
|
|
|
int test0(void) {
|
|
|
|
return opaque();
|
|
|
|
}
|
|
|
|
|
|
|
|
// <rdar://problem/8087431>: locally infer nounwind at -O0
|
2013-02-27 07:08:48 +08:00
|
|
|
// CHECK: define [[INT:i.*]] @test1() [[NUW:#[0-9]+]] {
|
|
|
|
// CHECK-NOEXC: define [[INT:i.*]] @test1() [[NUW]] {
|
2010-08-04 06:46:07 +08:00
|
|
|
int test1(void) {
|
2010-08-04 06:49:45 +08:00
|
|
|
return 0;
|
2008-08-12 02:40:47 +08:00
|
|
|
}
|
2010-08-12 06:38:33 +08:00
|
|
|
|
|
|
|
// <rdar://problem/8283071>: not for weak functions
|
2013-03-01 06:49:57 +08:00
|
|
|
// CHECK: define weak [[INT:i.*]] @test2() [[TF]] {
|
2013-02-27 07:08:48 +08:00
|
|
|
// CHECK-NOEXC: define weak [[INT:i.*]] @test2() [[NUW]] {
|
2010-08-12 06:38:33 +08:00
|
|
|
__attribute__((weak)) int test2(void) {
|
|
|
|
return 0;
|
|
|
|
}
|
2013-02-20 15:22:19 +08:00
|
|
|
|
2013-03-01 06:49:57 +08:00
|
|
|
// CHECK: attributes [[TF]] = { "{{.*}} }
|
2013-02-27 07:08:48 +08:00
|
|
|
// CHECK: attributes [[NUW]] = { nounwind{{.*}} }
|
2013-02-20 15:22:19 +08:00
|
|
|
|
2013-02-27 07:08:48 +08:00
|
|
|
// CHECK-NOEXC: attributes [[NUW]] = { nounwind{{.*}} }
|