Skip to content

Conversation

@sarnex
Copy link
Member

@sarnex sarnex commented Nov 21, 2025

Looks like I missed this when I added Triple::isGPU().

Signed-off-by: Nick Sarnie <nick.sarnie@intel.com>
@github-actions
Copy link

🐧 Linux x64 Test Results

  • 91133 tests passed
  • 2420 tests skipped
  • 2 tests failed

Failed Tests

(click on a test name to see its output)

ORC-x86_64-linux

ORC-x86_64-linux.TestCases/Linux/x86-64/lljit-ehframe.cpp (Likely Already Failing) This test is already failing at the base commit.
Exit Code: -9
Timeout: Reached timeout of 1200 seconds

Command Output (stderr):
--
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/./bin/clang  --driver-mode=g++  -m64  -fPIC -emit-llvm -c -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/runtimes/runtimes-bins/compiler-rt/test/orc/X86_64LinuxConfig/TestCases/Linux/x86-64/Output/lljit-ehframe.cpp.tmp /home/gha/actions-runner/_work/llvm-project/llvm-project/compiler-rt/test/orc/TestCases/Linux/x86-64/lljit-ehframe.cpp # RUN: at line 1
+ /home/gha/actions-runner/_work/llvm-project/llvm-project/build/./bin/clang --driver-mode=g++ -m64 -fPIC -emit-llvm -c -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/runtimes/runtimes-bins/compiler-rt/test/orc/X86_64LinuxConfig/TestCases/Linux/x86-64/Output/lljit-ehframe.cpp.tmp /home/gha/actions-runner/_work/llvm-project/llvm-project/compiler-rt/test/orc/TestCases/Linux/x86-64/lljit-ehframe.cpp
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/./bin/lli -jit-kind=orc -jit-linker=jitlink -orc-runtime=/home/gha/actions-runner/_work/llvm-project/llvm-project/build/./lib/../lib/clang/22/lib/x86_64-unknown-linux-gnu/liborc_rt.a -relocation-model=pic /home/gha/actions-runner/_work/llvm-project/llvm-project/build/runtimes/runtimes-bins/compiler-rt/test/orc/X86_64LinuxConfig/TestCases/Linux/x86-64/Output/lljit-ehframe.cpp.tmp | FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/compiler-rt/test/orc/TestCases/Linux/x86-64/lljit-ehframe.cpp # RUN: at line 2
+ /home/gha/actions-runner/_work/llvm-project/llvm-project/build/./bin/lli -jit-kind=orc -jit-linker=jitlink -orc-runtime=/home/gha/actions-runner/_work/llvm-project/llvm-project/build/./lib/../lib/clang/22/lib/x86_64-unknown-linux-gnu/liborc_rt.a -relocation-model=pic /home/gha/actions-runner/_work/llvm-project/llvm-project/build/runtimes/runtimes-bins/compiler-rt/test/orc/X86_64LinuxConfig/TestCases/Linux/x86-64/Output/lljit-ehframe.cpp.tmp
+ FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/compiler-rt/test/orc/TestCases/Linux/x86-64/lljit-ehframe.cpp
JIT session error: Invalid arch in ELF object file: 0

--

ORC-x86_64-linux.TestCases/Linux/x86-64/lljit-initialize-deinitialize.ll (Likely Already Failing) This test is already failing at the base commit.
Exit Code: -9
Timeout: Reached timeout of 1200 seconds

Command Output (stderr):
--
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/./bin/lli -jit-kind=orc -jit-linker=jitlink -orc-runtime=/home/gha/actions-runner/_work/llvm-project/llvm-project/build/./lib/../lib/clang/22/lib/x86_64-unknown-linux-gnu/liborc_rt.a /home/gha/actions-runner/_work/llvm-project/llvm-project/compiler-rt/test/orc/TestCases/Linux/x86-64/lljit-initialize-deinitialize.ll | FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/compiler-rt/test/orc/TestCases/Linux/x86-64/lljit-initialize-deinitialize.ll # RUN: at line 1
+ /home/gha/actions-runner/_work/llvm-project/llvm-project/build/./bin/lli -jit-kind=orc -jit-linker=jitlink -orc-runtime=/home/gha/actions-runner/_work/llvm-project/llvm-project/build/./lib/../lib/clang/22/lib/x86_64-unknown-linux-gnu/liborc_rt.a /home/gha/actions-runner/_work/llvm-project/llvm-project/compiler-rt/test/orc/TestCases/Linux/x86-64/lljit-initialize-deinitialize.ll
+ FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/compiler-rt/test/orc/TestCases/Linux/x86-64/lljit-initialize-deinitialize.ll
JIT session error: Invalid arch in ELF object file: 0

--

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the infrastructure label.

@sarnex sarnex marked this pull request as ready for review November 21, 2025 17:18
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:frontend Language frontend issues, e.g. anything involving "Sema" clang:openmp OpenMP related changes to Clang labels Nov 21, 2025
@llvmbot
Copy link
Member

llvmbot commented Nov 21, 2025

@llvm/pr-subscribers-clang

Author: Nick Sarnie (sarnex)

Changes

Looks like I missed this when i added Triple::isGPU().


Full diff: https://github.com/llvm/llvm-project/pull/169056.diff

3 Files Affected:

  • (modified) clang/lib/Sema/SemaExprCXX.cpp (+1-1)
  • (modified) clang/lib/Sema/SemaStmt.cpp (+2-2)
  • (renamed) clang/test/OpenMP/target_exceptions_messages.cpp (+22-6)
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp
index dc7ed4e9a48bc..3157119dd453e 100644
--- a/clang/lib/Sema/SemaExprCXX.cpp
+++ b/clang/lib/Sema/SemaExprCXX.cpp
@@ -852,7 +852,7 @@ ExprResult Sema::BuildCXXThrow(SourceLocation OpLoc, Expr *Ex,
                                bool IsThrownVarInScope) {
   const llvm::Triple &T = Context.getTargetInfo().getTriple();
   const bool IsOpenMPGPUTarget =
-      getLangOpts().OpenMPIsTargetDevice && (T.isNVPTX() || T.isAMDGCN());
+      getLangOpts().OpenMPIsTargetDevice && T.isGPU();
 
   DiagnoseExceptionUse(OpLoc, /* IsTry= */ false);
 
diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp
index 5b3ef1adf38e3..655fa31bbf5c7 100644
--- a/clang/lib/Sema/SemaStmt.cpp
+++ b/clang/lib/Sema/SemaStmt.cpp
@@ -4357,7 +4357,7 @@ StmtResult Sema::ActOnCXXTryBlock(SourceLocation TryLoc, Stmt *TryBlock,
                                   ArrayRef<Stmt *> Handlers) {
   const llvm::Triple &T = Context.getTargetInfo().getTriple();
   const bool IsOpenMPGPUTarget =
-      getLangOpts().OpenMPIsTargetDevice && (T.isNVPTX() || T.isAMDGCN());
+      getLangOpts().OpenMPIsTargetDevice && T.isGPU();
 
   DiagnoseExceptionUse(TryLoc, /* IsTry= */ true);
 
@@ -4464,7 +4464,7 @@ StmtResult Sema::ActOnCXXTryBlock(SourceLocation TryLoc, Stmt *TryBlock,
 void Sema::DiagnoseExceptionUse(SourceLocation Loc, bool IsTry) {
   const llvm::Triple &T = Context.getTargetInfo().getTriple();
   const bool IsOpenMPGPUTarget =
-      getLangOpts().OpenMPIsTargetDevice && (T.isNVPTX() || T.isAMDGCN());
+      getLangOpts().OpenMPIsTargetDevice && T.isGPU();
 
   // Don't report an error if 'try' is used in system headers or in an OpenMP
   // target region compiled for a GPU architecture.
diff --git a/clang/test/OpenMP/nvptx_target_exceptions_messages.cpp b/clang/test/OpenMP/target_exceptions_messages.cpp
similarity index 54%
rename from clang/test/OpenMP/nvptx_target_exceptions_messages.cpp
rename to clang/test/OpenMP/target_exceptions_messages.cpp
index 5d1d46cadff26..837fdb454c74f 100644
--- a/clang/test/OpenMP/nvptx_target_exceptions_messages.cpp
+++ b/clang/test/OpenMP/target_exceptions_messages.cpp
@@ -6,6 +6,22 @@
 // RUN:   -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - \
 // RUN:   -fexceptions -fcxx-exceptions -ferror-limit 100
 
+// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown \
+// RUN:   -verify=host -fopenmp-targets=amdgcn-amd-amdhsa -emit-llvm-bc \
+// RUN:   %s -o %t-ppc-host-amd.bc -fexceptions -fcxx-exceptions
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple amdgcn-amd-amdhsa \
+// RUN:   -fopenmp-targets=amdgcn-amd-amdhsa -emit-llvm %s \
+// RUN:   -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-ppc-host-amd.bc -o - \
+// RUN:   -fexceptions -fcxx-exceptions -ferror-limit 100
+
+// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown \
+// RUN:   -verify=host -fopenmp-targets=spirv64-intel -emit-llvm-bc \
+// RUN:   %s -o %t-ppc-host-spirv.bc -fexceptions -fcxx-exceptions
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple spirv64-intel \
+// RUN:   -fopenmp-targets=spirv64-intel -emit-llvm %s \
+// RUN:   -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-ppc-host-spirv.bc -o - \
+// RUN:   -fexceptions -fcxx-exceptions -ferror-limit 100
+
 #ifndef HEADER
 #define HEADER
 
@@ -34,7 +50,7 @@ T FA() {
 #pragma omp declare target
 struct S {
   int a;
-  S(int a) : a(a) { throw 1; } // expected-warning {{target 'nvptx64-unknown-unknown' does not support exception handling; 'throw' is assumed to be never reached}}
+  S(int a) : a(a) { throw 1; } // expected-warning-re {{target '{{.*}}' does not support exception handling; 'throw' is assumed to be never reached}}
 };
 
 int foo() { return 0; }
@@ -57,7 +73,7 @@ int maini1() {
     static long aaa = 23;
     a = foo() + bar() + b + c + d + aa + aaa + FA<int>(); // expected-note{{called by 'maini1'}}
     if (!a)
-      throw "Error"; // expected-warning {{target 'nvptx64-unknown-unknown' does not support exception handling; 'throw' is assumed to be never reached}}
+      throw "Error"; // expected-warning-re {{target '{{.*}}' does not support exception handling; 'throw' is assumed to be never reached}}
   }
   } catch(...) {
   }
@@ -67,14 +83,14 @@ int maini1() {
 int baz3() { return 2 + baz2(); }
 int baz2() {
 #pragma omp target
-  try { // expected-warning {{target 'nvptx64-unknown-unknown' does not support exception handling; 'catch' block is ignored}}
+  try { // expected-warning-re {{target '{{.*}}' does not support exception handling; 'catch' block is ignored}}
   ++c;
   } catch (...) {
   }
   return 2 + baz3();
 }
 
-int baz1() { throw 1; } // expected-warning {{target 'nvptx64-unknown-unknown' does not support exception handling; 'throw' is assumed to be never reached}}
+int baz1() { throw 1; } // expected-warning-re {{target '{{.*}}' does not support exception handling; 'throw' is assumed to be never reached}}
 
 int foobar1();
 int foobar2();
@@ -85,7 +101,7 @@ int (*B)() = &foobar2;
 #pragma omp end declare target
 
 int foobar1() { throw 1; }
-int foobar2() { throw 1; } // expected-warning {{target 'nvptx64-unknown-unknown' does not support exception handling; 'throw' is assumed to be never reached}}
+int foobar2() { throw 1; } // expected-warning-re {{target '{{.*}}' does not support exception handling; 'throw' is assumed to be never reached}}
 
 
 int foobar3();
@@ -95,7 +111,7 @@ int (*C)() = &foobar3; // expected-warning {{declaration is not declared in any
 int (*D)() = C; // expected-note {{used here}}
                 // host-note@-1 {{used here}}
 #pragma omp end declare target
-int foobar3() { throw 1; } // expected-warning {{target 'nvptx64-unknown-unknown' does not support exception handling; 'throw' is assumed to be never reached}}
+int foobar3() { throw 1; } // expected-warning-re {{target '{{.*}}' does not support exception handling; 'throw' is assumed to be never reached}}
 
 // Check no infinite recursion in deferred diagnostic emitter.
 long E = (long)&E;

@sarnex sarnex requested review from erichkeane and jhuber6 November 21, 2025 17:19
@github-actions
Copy link

🐧 Linux x64 Test Results

  • 91133 tests passed
  • 2420 tests skipped
  • 2 tests failed

Failed Tests

(click on a test name to see its output)

ORC-x86_64-linux

ORC-x86_64-linux.TestCases/Linux/x86-64/lljit-ehframe.cpp (Likely Already Failing) This test is already failing at the base commit.
Exit Code: -9
Timeout: Reached timeout of 1200 seconds

Command Output (stderr):
--
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/./bin/clang  --driver-mode=g++  -m64  -fPIC -emit-llvm -c -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/runtimes/runtimes-bins/compiler-rt/test/orc/X86_64LinuxConfig/TestCases/Linux/x86-64/Output/lljit-ehframe.cpp.tmp /home/gha/actions-runner/_work/llvm-project/llvm-project/compiler-rt/test/orc/TestCases/Linux/x86-64/lljit-ehframe.cpp # RUN: at line 1
+ /home/gha/actions-runner/_work/llvm-project/llvm-project/build/./bin/clang --driver-mode=g++ -m64 -fPIC -emit-llvm -c -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/runtimes/runtimes-bins/compiler-rt/test/orc/X86_64LinuxConfig/TestCases/Linux/x86-64/Output/lljit-ehframe.cpp.tmp /home/gha/actions-runner/_work/llvm-project/llvm-project/compiler-rt/test/orc/TestCases/Linux/x86-64/lljit-ehframe.cpp
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/./bin/lli -jit-kind=orc -jit-linker=jitlink -orc-runtime=/home/gha/actions-runner/_work/llvm-project/llvm-project/build/./lib/../lib/clang/22/lib/x86_64-unknown-linux-gnu/liborc_rt.a -relocation-model=pic /home/gha/actions-runner/_work/llvm-project/llvm-project/build/runtimes/runtimes-bins/compiler-rt/test/orc/X86_64LinuxConfig/TestCases/Linux/x86-64/Output/lljit-ehframe.cpp.tmp | FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/compiler-rt/test/orc/TestCases/Linux/x86-64/lljit-ehframe.cpp # RUN: at line 2
+ /home/gha/actions-runner/_work/llvm-project/llvm-project/build/./bin/lli -jit-kind=orc -jit-linker=jitlink -orc-runtime=/home/gha/actions-runner/_work/llvm-project/llvm-project/build/./lib/../lib/clang/22/lib/x86_64-unknown-linux-gnu/liborc_rt.a -relocation-model=pic /home/gha/actions-runner/_work/llvm-project/llvm-project/build/runtimes/runtimes-bins/compiler-rt/test/orc/X86_64LinuxConfig/TestCases/Linux/x86-64/Output/lljit-ehframe.cpp.tmp
+ FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/compiler-rt/test/orc/TestCases/Linux/x86-64/lljit-ehframe.cpp
JIT session error: Invalid arch in ELF object file: 0

--

ORC-x86_64-linux.TestCases/Linux/x86-64/lljit-initialize-deinitialize.ll (Likely Already Failing) This test is already failing at the base commit.
Exit Code: -9
Timeout: Reached timeout of 1200 seconds

Command Output (stderr):
--
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/./bin/lli -jit-kind=orc -jit-linker=jitlink -orc-runtime=/home/gha/actions-runner/_work/llvm-project/llvm-project/build/./lib/../lib/clang/22/lib/x86_64-unknown-linux-gnu/liborc_rt.a /home/gha/actions-runner/_work/llvm-project/llvm-project/compiler-rt/test/orc/TestCases/Linux/x86-64/lljit-initialize-deinitialize.ll | FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/compiler-rt/test/orc/TestCases/Linux/x86-64/lljit-initialize-deinitialize.ll # RUN: at line 1
+ /home/gha/actions-runner/_work/llvm-project/llvm-project/build/./bin/lli -jit-kind=orc -jit-linker=jitlink -orc-runtime=/home/gha/actions-runner/_work/llvm-project/llvm-project/build/./lib/../lib/clang/22/lib/x86_64-unknown-linux-gnu/liborc_rt.a /home/gha/actions-runner/_work/llvm-project/llvm-project/compiler-rt/test/orc/TestCases/Linux/x86-64/lljit-initialize-deinitialize.ll
+ FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/compiler-rt/test/orc/TestCases/Linux/x86-64/lljit-initialize-deinitialize.ll
JIT session error: Invalid arch in ELF object file: 0

--

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the infrastructure label.

@sarnex sarnex merged commit 226c51c into llvm:main Nov 21, 2025
18 of 20 checks passed
aadeshps-mcw pushed a commit to aadeshps-mcw/llvm-project that referenced this pull request Nov 26, 2025
Looks like I missed this when I added `Triple::isGPU()`.

Signed-off-by: Nick Sarnie <nick.sarnie@intel.com>
Priyanshu3820 pushed a commit to Priyanshu3820/llvm-project that referenced this pull request Nov 26, 2025
Looks like I missed this when I added `Triple::isGPU()`.

Signed-off-by: Nick Sarnie <nick.sarnie@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:frontend Language frontend issues, e.g. anything involving "Sema" clang:openmp OpenMP related changes to Clang clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants