blob: e505a6e9e2778e86c606b0bbe4f7658b9d51822e [file] [log] [blame]
Ulrich Weigand92309972012-10-24 12:22:56 +00001// 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 Dunbar709c00c2008-08-11 18:40:47 +00003
John McCall39dad532010-08-03 22:46:07 +00004int opaque();
5
Bill Wendlingbe9e8bf2013-02-28 22:49:57 +00006// CHECK: define [[INT:i.*]] @test0() [[TF:#[0-9]+]] {
Bill Wendlingc3af6792013-02-26 23:08:48 +00007// CHECK-NOEXC: define [[INT:i.*]] @test0() [[NUW:#[0-9]+]] {
John McCall39dad532010-08-03 22:46:07 +00008int test0(void) {
9 return opaque();
10}
11
12// <rdar://problem/8087431>: locally infer nounwind at -O0
Bill Wendlingc3af6792013-02-26 23:08:48 +000013// CHECK: define [[INT:i.*]] @test1() [[NUW:#[0-9]+]] {
14// CHECK-NOEXC: define [[INT:i.*]] @test1() [[NUW]] {
John McCall39dad532010-08-03 22:46:07 +000015int test1(void) {
John McCall03b0df92010-08-03 22:49:45 +000016 return 0;
Daniel Dunbar709c00c2008-08-11 18:40:47 +000017}
John McCallb3a29f12010-08-11 22:38:33 +000018
19// <rdar://problem/8283071>: not for weak functions
Bill Wendlingbe9e8bf2013-02-28 22:49:57 +000020// CHECK: define weak [[INT:i.*]] @test2() [[TF]] {
Bill Wendlingc3af6792013-02-26 23:08:48 +000021// CHECK-NOEXC: define weak [[INT:i.*]] @test2() [[NUW]] {
John McCallb3a29f12010-08-11 22:38:33 +000022__attribute__((weak)) int test2(void) {
23 return 0;
24}
Bill Wendlingf7a9da02013-02-20 07:22:19 +000025
Bill Wendlingbe9e8bf2013-02-28 22:49:57 +000026// CHECK: attributes [[TF]] = { "{{.*}} }
Bill Wendlingc3af6792013-02-26 23:08:48 +000027// CHECK: attributes [[NUW]] = { nounwind{{.*}} }
Bill Wendlingf7a9da02013-02-20 07:22:19 +000028
Bill Wendlingc3af6792013-02-26 23:08:48 +000029// CHECK-NOEXC: attributes [[NUW]] = { nounwind{{.*}} }