|
| 1 | +// REQUIRES: amdgpu-registered-target |
| 2 | + |
| 3 | +// Default options |
| 4 | +// RUN: %clang -### -x cl -target amdgcn-amd-amdhsa -c -emit-llvm --no-offloadlib %s 2>&1 | FileCheck -check-prefix=ASYNC-TABLES %s |
| 5 | +// RUN: %clang -### -x hip --offload-arch=gfx90a --offload-device-only --no-offloadlib -c -emit-llvm %s 2>&1 | FileCheck -check-prefix=ASYNC-TABLES %s |
| 6 | +// RUN: %clang -### -fopenmp --offload-arch=gfx90a --offload-device-only --no-offloadlib -c -emit-llvm %s 2>&1 | FileCheck -check-prefix=ASYNC-TABLES %s |
| 7 | + |
| 8 | +// Explicitly enable sync-tables (somewhat surprisingly this is still preempted by the default-on async tables) |
| 9 | +// RUN: %clang -### -x cl -target amdgcn-amd-amdhsa -c -emit-llvm --no-offloadlib -funwind-tables %s 2>&1 | FileCheck -check-prefix=ASYNC-TABLES %s |
| 10 | +// RUN: %clang -### -x hip --offload-arch=gfx90a --offload-device-only --no-offloadlib -c -emit-llvm -funwind-tables %s 2>&1 | FileCheck -check-prefix=ASYNC-TABLES %s |
| 11 | +// RUN: %clang -### -fopenmp --offload-arch=gfx90a --offload-device-only --no-offloadlib -c -emit-llvm -funwind-tables %s 2>&1 | FileCheck -check-prefix=ASYNC-TABLES %s |
| 12 | + |
| 13 | +// Explicitly enable sync-tables and surpress default async-tables |
| 14 | +// RUN: %clang -### -x cl -target amdgcn-amd-amdhsa -c -emit-llvm --no-offloadlib -funwind-tables -fno-asynchronous-unwind-tables %s 2>&1 | FileCheck -check-prefix=SYNC-TABLES %s |
| 15 | +// RUN: %clang -### -x hip --offload-arch=gfx90a --offload-device-only --no-offloadlib -c -emit-llvm -funwind-tables -fno-asynchronous-unwind-tables %s 2>&1 | FileCheck -check-prefix=SYNC-TABLES %s |
| 16 | +// RUN: %clang -### -fopenmp --offload-arch=gfx90a --offload-device-only --no-offloadlib -c -emit-llvm -funwind-tables -fno-asynchronous-unwind-tables %s 2>&1 | FileCheck -check-prefix=SYNC-TABLES %s |
| 17 | + |
| 18 | +// Suppress the default async-tables |
| 19 | +// RUN: %clang -### -x cl -target amdgcn-amd-amdhsa -c -emit-llvm --no-offloadlib -fno-asynchronous-unwind-tables %s 2>&1 | FileCheck -check-prefix=NO-TABLES %s |
| 20 | +// RUN: %clang -### -x hip --offload-arch=gfx90a --offload-device-only --no-offloadlib -c -emit-llvm -fno-asynchronous-unwind-tables %s 2>&1 | FileCheck -check-prefix=NO-TABLES %s |
| 21 | +// RUN: %clang -### -fopenmp --offload-arch=gfx90a --offload-device-only --no-offloadlib -c -emit-llvm -fno-asynchronous-unwind-tables %s 2>&1 | FileCheck -check-prefix=NO-TABLES %s |
| 22 | + |
| 23 | + |
| 24 | +// ASYNC-TABLES: "-triple" "amdgcn-amd-amdhsa" {{.*}} "-funwind-tables=2" |
| 25 | +// SYNC-TABLES: "-triple" "amdgcn-amd-amdhsa" {{.*}} "-funwind-tables=1" |
| 26 | +// NO-TABLES-NOT: "-triple" "amdgcn-amd-amdhsa" {{.*}} "-funwind-tables={{.*}}" |
0 commit comments