Skip to content

Commit fce8190

Browse files
[SYCL][ESIMD] Fix ESIMD private global detection.
Signed-off-by: Denis Bakhvalov <[email protected]>
1 parent 2e73da7 commit fce8190

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
@@ -12687,7 +12687,7 @@ class Sema final {
1268712687
bool isSYCLEsimdPrivateGlobal(VarDecl *VDecl) {
1268812688
return getLangOpts().SYCLIsDevice && getLangOpts().SYCLExplicitSIMD &&
1268912689
VDecl->hasGlobalStorage() &&
12690-
(VDecl->getType().getAddressSpace() != LangAS::opencl_constant);
12690+
(VDecl->getType().getAddressSpace() == LangAS::opencl_private);
1269112691
}
1269212692
};
1269312693

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)