Skip to content

Commit 31ef4a2

Browse files
Add test to check if "unreachable" instruction is emitted for sycl devices
1 parent c8a778b commit 31ef4a2

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// RUN: %clang_cc1 -fsycl -fsycl-is-device -triple spir64-unknown-unknown-sycldevice -emit-llvm %s -o - | FileCheck %s
2+
3+
4+
SYCL_EXTERNAL void doesNotReturn ()
5+
throw () __attribute__ ((__noreturn__));
6+
7+
8+
template <typename name, typename Func>
9+
__attribute__((sycl_kernel)) void kernel(Func kernelFunc) {
10+
kernelFunc();
11+
}
12+
13+
int main() {
14+
kernel<class test>([]() {
15+
doesNotReturn();
16+
// CHECK-NOT: unreachable
17+
});
18+
return 0;
19+
}

0 commit comments

Comments
 (0)