forked from OSchip/llvm-project
[SYCL] Ignore file-scope asm during device-side SYCL compilation.
Reviewed By: bader, eandrews Differential Revision: https://reviews.llvm.org/D96538
This commit is contained in:
parent
982b891905
commit
ff50b121e3
|
@ -5672,6 +5672,9 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) {
|
|||
// File-scope asm is ignored during device-side OpenMP compilation.
|
||||
if (LangOpts.OpenMPIsDevice)
|
||||
break;
|
||||
// File-scope asm is ignored during device-side SYCL compilation.
|
||||
if (LangOpts.SYCLIsDevice)
|
||||
break;
|
||||
auto *AD = cast<FileScopeAsmDecl>(D);
|
||||
getModule().appendModuleInlineAsm(AD->getAsmString()->getString());
|
||||
break;
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
// RUN: %clang_cc1 -fsycl -fsycl-is-device -triple spir64-unknown-unknown-sycldevice -emit-llvm %s -o - | FileCheck %s
|
||||
//
|
||||
// Check that file-scope asm is ignored during device-side SYCL compilation.
|
||||
//
|
||||
// CHECK-NOT: module asm "foo"
|
||||
__asm__("foo");
|
Loading…
Reference in New Issue