Skip to content

Commit b1371f5

Browse files
authored
[SYCL] Ignore file-scope asm during device-side SYCL compilation. (#3200)
Signed-off-by: Artur Gainullin <[email protected]>
1 parent b249099 commit b1371f5

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

clang/lib/CodeGen/CodeGenModule.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6037,6 +6037,9 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) {
60376037
// File-scope asm is ignored during device-side OpenMP compilation.
60386038
if (LangOpts.OpenMPIsDevice)
60396039
break;
6040+
// File-scope asm is ignored during device-side SYCL compilation.
6041+
if (LangOpts.SYCLIsDevice)
6042+
break;
60406043
auto *AD = cast<FileScopeAsmDecl>(D);
60416044
getModule().appendModuleInlineAsm(AD->getAsmString()->getString());
60426045
break;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// RUN: %clang_cc1 -fsycl -fsycl-is-device -triple spir64-unknown-unknown-sycldevice -emit-llvm %s -o - | FileCheck %s
2+
//
3+
// Check that file-scope asm is ignored during device-side SYCL compilation.
4+
//
5+
// CHECK-NOT: module asm "foo"
6+
__asm__("foo");

0 commit comments

Comments
 (0)