Skip to content

Commit 65262ba

Browse files
committed
Add tests for sycl_external attribute
1 parent d20382c commit 65262ba

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// RUN: %clang_cc1 -fsycl-is-device -fsyntax-only -verify %s
2+
3+
// expected-warning@+1{{'sycl_external' attribute only applies to functions}}
4+
[[clang::sycl_external]] int a;
5+
6+
7+
// expected-warning@+2{{'sycl_external' attribute only applies to functions}}
8+
struct s {
9+
[[clang::sycl_external]] int b;
10+
};
11+
12+
// FIXME: The first declaration of a function is required to have the attribute.
13+
// The attribute may be optionally present on subsequent declarations
14+
int foo(int c);
15+
16+
[[clang::sycl_external]] void foo();
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// RUN: %clang_cc1 -fsyntax-only -verify %s
2+
3+
// expected-warning@+1{{'sycl_external' attribute ignored}}
4+
[[clang::sycl_external]] void bar() {}
5+
6+
// expected-warning@+1{{'sycl_external' attribute ignored}}
7+
[[clang::sycl_external]] int a;
8+
9+
// expected-warning@+2{{'sycl_external' attribute ignored}}
10+
namespace not_sycl {
11+
[[clang::sycl_external]] void foo() {}
12+
}

0 commit comments

Comments
 (0)