Skip to content

Commit 616a396

Browse files
[SYCL][ESIMD] Fix ESIMD private global detection. (#1909)
Signed-off-by: Denis Bakhvalov <denis.bakhvalov@intel.com>
1 parent 34b5f21 commit 616a396

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

clang/include/clang/Sema/Sema.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12700,7 +12700,7 @@ class Sema final {
1270012700
bool isSYCLEsimdPrivateGlobal(VarDecl *VDecl) {
1270112701
return getLangOpts().SYCLIsDevice && getLangOpts().SYCLExplicitSIMD &&
1270212702
VDecl->hasGlobalStorage() &&
12703-
(VDecl->getType().getAddressSpace() != LangAS::opencl_constant);
12703+
(VDecl->getType().getAddressSpace() == LangAS::opencl_private);
1270412704
}
1270512705
};
1270612706

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// RUN: %clang_cc1 -fsycl -fsycl-is-device -fsycl-explicit-simd -fsyntax-only -verify %s
2+
// expected-no-diagnostics
3+
int x = 0;

0 commit comments

Comments
 (0)