33 lines · c
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).3 4// RUN: %clang -target x86_64-linux -S -emit-llvm -o - %s | FileCheck %s -check-prefixes=CHECK,DEFAULT5// RUN: %clang -target x86_64-linux -S -emit-llvm -o - %s -funwind-tables -fno-asynchronous-unwind-tables | FileCheck %s -check-prefixes=CHECK,TABLES6// RUN: %clang -target x86_64-linux -S -emit-llvm -o - %s -fno-unwind-tables -fno-asynchronous-unwind-tables | FileCheck %s -check-prefixes=CHECK,NO_TABLES7 8// RUN: %clang -target x86_64-linux -S -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefixes=CHECK,DEFAULT9// RUN: %clang -target x86_64-linux -S -emit-llvm -o - -x c++ %s -funwind-tables -fno-asynchronous-unwind-tables | FileCheck %s -check-prefixes=CHECK,TABLES10// 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_TABLES11 12// REQUIRES: x86-registered-target13 14#ifdef __cplusplus15extern "C" void g(void);16struct S { ~S(); };17extern "C" int f() { S s; g(); return 0;};18#else19void g(void);20int f(void) { g(); return 0; };21#endif22 23// CHECK: define {{.*}} @f() #[[#F:]]24// CHECK: declare {{.*}} @g() #[[#]]25 26// DEFAULT: attributes #[[#F]] = { {{.*}} uwtable{{ }}{{.*}} }27// DEFAULT: ![[#]] = !{i32 7, !"uwtable", i32 2}28 29// TABLES: attributes #[[#F]] = { {{.*}} uwtable(sync){{.*}} }30// TABLES: ![[#]] = !{i32 7, !"uwtable", i32 1}31 32// NO_TABLES-NOT: uwtable33