Skip to content

Commit 00636ba

Browse files
author
iclsrc
committed
Merge from 'sycl' to 'sycl-web' (1 commits)
2 parents 8738d30 + 9f53a78 commit 00636ba

File tree

4 files changed

+23
-9
lines changed

4 files changed

+23
-9
lines changed

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12510,9 +12510,8 @@ def err_sycl_function_attribute_mismatch : Error<
1251012510
def err_sycl_x_y_z_arguments_must_be_one : Error<
1251112511
"all %0 attribute arguments must be '1' when the %1 attribute argument is '0'">;
1251212512
def err_sycl_attribute_internal_decl
12513-
: Error<"%0 attribute cannot be applied to a "
12514-
"static %select{function|variable}1 or %select{function|variable}1 "
12515-
"in an anonymous namespace">;
12513+
: Error<"%0 attribute cannot be applied to a %select{function|variable}1"
12514+
" without external linkage">;
1251612515
def err_sycl_attribute_not_device_global
1251712516
: Error<"%0 attribute can only be applied to 'device_global' variables">;
1251812517
def err_fpga_attribute_incorrect_variable

clang/test/SemaSYCL/device-indirectly-callable-attr.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,21 @@ int N;
1212
void
1313
bar() {}
1414

15-
[[intel::device_indirectly_callable]] // expected-error {{'device_indirectly_callable' attribute cannot be applied to a static function or function in an anonymous namespace}}
15+
[[intel::device_indirectly_callable]] // expected-error {{'device_indirectly_callable' attribute cannot be applied to a function without external linkage}}
1616
static void
1717
func1() {}
1818

1919
namespace {
20-
[[intel::device_indirectly_callable]] // expected-error {{'device_indirectly_callable' attribute cannot be applied to a static function or function in an anonymous namespace}}
20+
[[intel::device_indirectly_callable]] // expected-error {{'device_indirectly_callable' attribute cannot be applied to a function without external linkage}}
2121
void
2222
func2() {}
23+
24+
struct UnnX {};
2325
}
2426

27+
[[intel::device_indirectly_callable]] // expected-error {{'device_indirectly_callable' attribute cannot be applied to a function without external linkage}}
28+
void func4(UnnX) {}
29+
2530
class A {
2631
[[intel::device_indirectly_callable]] A() {}
2732

clang/test/SemaSYCL/device_global_external.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using namespace sycl::ext::oneapi;
66

77
SYCL_EXTERNAL device_global<int> glob;
8-
// expected-error@+1{{'sycl_device' attribute cannot be applied to a static variable or variable in an anonymous namespace}}
8+
// expected-error@+1{{'sycl_device' attribute cannot be applied to a variable without external linkage}}
99
SYCL_EXTERNAL static device_global<float> static_glob;
1010

1111
namespace foo {
@@ -20,10 +20,15 @@ struct RandomStruct {
2020
SYCL_EXTERNAL RandomStruct S;
2121

2222
namespace {
23-
// expected-error@+1{{'sycl_device' attribute cannot be applied to a static variable or variable in an anonymous namespace}}
23+
// expected-error@+1{{'sycl_device' attribute cannot be applied to a variable without external linkage}}
2424
SYCL_EXTERNAL device_global<int> same_name;
25+
26+
struct UnnX {};
2527
} // namespace
2628

29+
// expected-error@+1{{'sycl_device' attribute cannot be applied to a variable without external linkage}}
30+
SYCL_EXTERNAL device_global<UnnX> dg_x;
31+
2732
// expected-error@+1{{'sycl_device' attribute can only be applied to 'device_global' variables}}
2833
SYCL_EXTERNAL int AAA;
2934

clang/test/SemaSYCL/sycl-device.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,19 @@ int N;
1212
__attribute__((sycl_device(3))) // expected-error {{'sycl_device' attribute takes no arguments}}
1313
void bar() {}
1414

15-
__attribute__((sycl_device)) // expected-error {{'sycl_device' attribute cannot be applied to a static function or function in an anonymous namespace}}
15+
__attribute__((sycl_device)) // expected-error {{'sycl_device' attribute cannot be applied to a function without external linkage}}
1616
static void func1() {}
1717

1818
namespace {
19-
__attribute__((sycl_device)) // expected-error {{'sycl_device' attribute cannot be applied to a static function or function in an anonymous namespace}}
19+
__attribute__((sycl_device)) // expected-error {{'sycl_device' attribute cannot be applied to a function without external linkage}}
2020
void func2() {}
21+
22+
struct UnnX {};
2123
}
2224

25+
__attribute__((sycl_device)) // expected-error {{'sycl_device' attribute cannot be applied to a function without external linkage}}
26+
void func4(UnnX) {}
27+
2328
class A {
2429
__attribute__((sycl_device))
2530
A() {}

0 commit comments

Comments
 (0)