1 // Test that function and modules attributes react on the command-line options,
2 // it does not state the current behaviour makes sense in all cases (it does not).
4 // RUN: %clang -target x86_64-linux -S -emit-llvm -o - %s | FileCheck %s -check-prefixes=CHECK,DEFAULT
5 // RUN: %clang -target x86_64-linux -S -emit-llvm -o - %s -funwind-tables -fno-asynchronous-unwind-tables | FileCheck %s -check-prefixes=CHECK,TABLES
6 // RUN: %clang -target x86_64-linux -S -emit-llvm -o - %s -fno-unwind-tables -fno-asynchronous-unwind-tables | FileCheck %s -check-prefixes=CHECK,NO_TABLES
8 // RUN: %clang -target x86_64-linux -S -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefixes=CHECK,DEFAULT
9 // RUN: %clang -target x86_64-linux -S -emit-llvm -o - -x c++ %s -funwind-tables -fno-asynchronous-unwind-tables | FileCheck %s -check-prefixes=CHECK,TABLES
10 // RUN: %clang -target x86_64-linux -S -emit-llvm -o - -x c++ %s -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables | FileCheck %s -check-prefixes=CHECK,NO_TABLES
12 // REQUIRES: x86-registered-target
15 extern "C" void g(void);
17 extern "C" int f() { S s
; g(); return 0;};
20 int f(void) { g(); return 0; };
23 // CHECK: define {{.*}} @f() #[[#F:]]
24 // CHECK: declare {{.*}} @g() #[[#]]
26 // DEFAULT: attributes #[[#F]] = { {{.*}} uwtable{{ }}{{.*}} }
27 // DEFAULT: ![[#]] = !{i32 7, !"uwtable", i32 2}
29 // TABLES: attributes #[[#F]] = { {{.*}} uwtable(sync){{.*}} }
30 // TABLES: ![[#]] = !{i32 7, !"uwtable", i32 1}
32 // NO_TABLES-NOT: uwtable