[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGen / unwind-attr.c
blob50cbd6df771845c0cfd15178e70eb5704100e1f9
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 CHECK-NOEXC %s
4 int opaque(void);
6 // CHECK: define{{.*}} [[INT:i.*]] @test0() [[TF:#[0-9]+]] {
7 // CHECK-NOEXC: define{{.*}} [[INT:i.*]] @test0() [[NUW:#[0-9]+]] {
8 int test0(void) {
9 return opaque();
12 // <rdar://problem/8087431>: locally infer nounwind at -O0
13 // CHECK: define{{.*}} [[INT:i.*]] @test1() [[NUW:#[0-9]+]] {
14 // CHECK-NOEXC: define{{.*}} [[INT:i.*]] @test1() [[NUW]] {
15 int test1(void) {
16 return 0;
19 // <rdar://problem/8283071>: not for weak functions
20 // CHECK: define weak{{.*}} [[INT:i.*]] @test2() [[TF]] {
21 // CHECK-NOEXC: define weak{{.*}} [[INT:i.*]] @test2() [[NUW]] {
22 __attribute__((weak)) int test2(void) {
23 return 0;
26 // CHECK: attributes [[TF]] = { noinline optnone "{{.*}} }
27 // CHECK: attributes [[NUW]] = { noinline nounwind{{.*}} }
29 // CHECK-NOEXC: attributes [[NUW]] = { noinline nounwind{{.*}} }