|
| 1 | +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o %t-none.cir |
| 2 | +// RUN: FileCheck %s --input-file=%t-none.cir --check-prefix=CIR-NONE |
| 3 | +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir -funwind-tables=0 %s -o %t-none-explicit.cir |
| 4 | +// RUN: FileCheck %s --input-file=%t-none-explicit.cir --check-prefix=CIR-NONE |
| 5 | +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir -funwind-tables=1 %s -o %t-sync.cir |
| 6 | +// RUN: FileCheck %s --input-file=%t-sync.cir --check-prefix=CIR-SYNC |
| 7 | +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir -funwind-tables=2 %s -o %t-async.cir |
| 8 | +// RUN: FileCheck %s --input-file=%t-async.cir --check-prefix=CIR-ASYNC |
| 9 | + |
| 10 | +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-llvm %s -o %t-none.ll |
| 11 | +// RUN: FileCheck %s --input-file=%t-none.ll --check-prefix=LLVM-NONE |
| 12 | +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-llvm -funwind-tables=0 %s -o %t-none-explicit.ll |
| 13 | +// RUN: FileCheck %s --input-file=%t-none-explicit.ll --check-prefix=LLVM-NONE |
| 14 | +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-llvm -funwind-tables=1 %s -o %t-sync.ll |
| 15 | +// RUN: FileCheck %s --input-file=%t-sync.ll --check-prefix=LLVM-SYNC |
| 16 | +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-llvm -funwind-tables=2 %s -o %t-async.ll |
| 17 | +// RUN: FileCheck %s --input-file=%t-async.ll --check-prefix=LLVM-ASYNC |
| 18 | + |
| 19 | +// CIR-NONE-NOT: #cir.uwtable |
| 20 | + |
| 21 | +// CIR-SYNC-DAG: module {{.*}} attributes {{{.*}}cir.uwtable = #cir.uwtable<sync> |
| 22 | +// CIR-SYNC-DAG: cir.func @_Z1fv() extra(#[[f_attr:.*]]) |
| 23 | +// CIR-SYNC-DAG: cir.func @_Z1gv() extra(#[[g_attr:.*]]) |
| 24 | +// CIR-SYNC-DAG: #[[f_attr]] = #cir<extra({{{.*}}uwtable = #cir.uwtable<sync> |
| 25 | +// CIR-SYNC-DAG: #[[g_attr]] = |
| 26 | +// CIR-SYNC-NOT: #cir.uwtable |
| 27 | + |
| 28 | +// CIR-ASYNC-DAG: module {{.*}} attributes {{{.*}}cir.uwtable = #cir.uwtable<async> |
| 29 | +// CIR-ASYNC-DAG: cir.func @_Z1fv() extra(#[[f_attr:.*]]) |
| 30 | +// CIR-ASYNC-DAG: cir.func @_Z1gv() extra(#[[g_attr:.*]]) |
| 31 | +// CIR-ASYNC-DAG: #[[f_attr]] = #cir<extra({{{.*}}uwtable = #cir.uwtable<async> |
| 32 | +// CIR-ASYNC-DAG: #[[g_attr]] = |
| 33 | +// CIR-ASYNC-NOT: #cir.uwtable |
| 34 | + |
| 35 | +// Avoid matching "uwtable" in the ModuleID and source_filename comments. |
| 36 | +// LLVM-NONE: define {{.*}} @_Z1fv() |
| 37 | +// LLVM-NONE-NOT: uwtable |
| 38 | + |
| 39 | +// LLVM-SYNC: define {{.*}} @_Z1fv() #[[#F_ATTRS:]] |
| 40 | +// LLVM-SYNC: define {{.*}} @_Z1gv() #[[#G_ATTRS:]] |
| 41 | +// LLVM-SYNC: attributes #[[#F_ATTRS]] = {{{.*}}uwtable(sync) |
| 42 | +// LLVM-SYNC: attributes #[[#G_ATTRS]] = |
| 43 | +// LLVM-SYNC-NOT: uwtable |
| 44 | +// LLVM-SYNC-DAG: ![[#METADATA:]] = !{i32 7, !"uwtable", i32 1} |
| 45 | +// LLVM-SYNC-DAG: !llvm.module.flags = !{{{.*}}[[#METADATA]] |
| 46 | + |
| 47 | +// LLVM-ASYNC: define {{.*}} @_Z1fv() #[[#ATTRS:]] |
| 48 | +// LLVM-ASYNC: define {{.*}} @_Z1gv() #[[#G_ATTRS:]] |
| 49 | +// LLVM-ASYNC: attributes #[[#ATTRS]] = {{{.*}}uwtable{{ }} |
| 50 | +// LLVM-ASYNC: attributes #[[#G_ATTRS]] = |
| 51 | +// LLVM-ASYNC-NOT: uwtable |
| 52 | +// LLVM-ASYNC-DAG: ![[#METADATA:]] = !{i32 7, !"uwtable", i32 2} |
| 53 | +// LLVM-ASYNC-DAG: !llvm.module.flags = !{{{.*}}[[#METADATA]] |
| 54 | +void f() {} |
| 55 | + |
| 56 | +[[clang::nouwtable]] void g() {} |
0 commit comments