Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions clang/lib/Driver/ToolChains/Gnu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3068,6 +3068,7 @@ Generic_GCC::getDefaultUnwindTableLevel(const ArgList &Args) const {
switch (getArch()) {
case llvm::Triple::aarch64:
case llvm::Triple::aarch64_be:
case llvm::Triple::amdgcn:
case llvm::Triple::ppc:
case llvm::Triple::ppcle:
case llvm::Triple::ppc64:
Expand Down
26 changes: 26 additions & 0 deletions clang/test/Driver/amdgpu-unwind.cl
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// REQUIRES: amdgpu-registered-target

// Default options
// RUN: %clang -### -x cl --target=amdgcn-amd-amdhsa -c -emit-llvm --no-offloadlib -nogpuinc %s 2>&1 | FileCheck -check-prefix=ASYNC-TABLES %s

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I understand that you want to cover various combinations, 12 new RUN lines is too much for this change.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's kind of not, the various language drivers take pretty different paths

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

though really we should get down to 2. There's pointless divergence between openmp and hip

// RUN: %clang -### -x hip --offload-arch=gfx90a --offload-device-only --no-offloadlib -c -emit-llvm -nogpuinc %s 2>&1 | FileCheck -check-prefix=ASYNC-TABLES %s
// RUN: %clang -### -fopenmp --offload-arch=gfx90a --offload-device-only --no-offloadlib -c -emit-llvm -nogpuinc %s 2>&1 | FileCheck -check-prefix=ASYNC-TABLES %s

// Explicitly enable sync-tables (somewhat surprisingly this is still preempted by the default-on async tables)
// RUN: %clang -### -x cl --target=amdgcn-amd-amdhsa -c -emit-llvm --no-offloadlib -funwind-tables -nogpuinc %s 2>&1 | FileCheck -check-prefix=ASYNC-TABLES %s
// RUN: %clang -### -x hip --offload-arch=gfx90a --offload-device-only --no-offloadlib -c -emit-llvm -funwind-tables -nogpuinc %s 2>&1 | FileCheck -check-prefix=ASYNC-TABLES %s
// RUN: %clang -### -fopenmp --offload-arch=gfx90a --offload-device-only --no-offloadlib -c -emit-llvm -funwind-tables -nogpuinc %s 2>&1 | FileCheck -check-prefix=ASYNC-TABLES %s

// Explicitly enable sync-tables and surpress default async-tables
// RUN: %clang -### -x cl --target=amdgcn-amd-amdhsa -c -emit-llvm --no-offloadlib -funwind-tables -fno-asynchronous-unwind-tables -nogpuinc %s 2>&1 | FileCheck -check-prefix=SYNC-TABLES %s
// RUN: %clang -### -x hip --offload-arch=gfx90a --offload-device-only --no-offloadlib -c -emit-llvm -funwind-tables -fno-asynchronous-unwind-tables -nogpuinc %s 2>&1 | FileCheck -check-prefix=SYNC-TABLES %s
// RUN: %clang -### -fopenmp --offload-arch=gfx90a --offload-device-only --no-offloadlib -c -emit-llvm -funwind-tables -fno-asynchronous-unwind-tables -nogpuinc %s 2>&1 | FileCheck -check-prefix=SYNC-TABLES %s

// Suppress the default async-tables
// RUN: %clang -### -x cl --target=amdgcn-amd-amdhsa -c -emit-llvm --no-offloadlib -fno-asynchronous-unwind-tables -nogpuinc %s 2>&1 | FileCheck -check-prefix=NO-TABLES %s
// RUN: %clang -### -x hip --offload-arch=gfx90a --offload-device-only --no-offloadlib -c -emit-llvm -fno-asynchronous-unwind-tables -nogpuinc %s 2>&1 | FileCheck -check-prefix=NO-TABLES %s
// RUN: %clang -### -fopenmp --offload-arch=gfx90a --offload-device-only --no-offloadlib -c -emit-llvm -fno-asynchronous-unwind-tables -nogpuinc %s 2>&1 | FileCheck -check-prefix=NO-TABLES %s


// ASYNC-TABLES: "-triple" "amdgcn-amd-amdhsa" {{.*}} "-funwind-tables=2"
// SYNC-TABLES: "-triple" "amdgcn-amd-amdhsa" {{.*}} "-funwind-tables=1"
// NO-TABLES-NOT: "-triple" "amdgcn-amd-amdhsa" {{.*}} "-funwind-tables={{.*}}"
Loading