Skip to content

Commit 9455285

Browse files
committed
Add negative test for construct kernel
1 parent 6a45f70 commit 9455285

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
; RUN: opt -passes=sycl-propagate-aspects-usage < %s -S | FileCheck %s
2+
target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64-G1"
3+
target triple = "spir64-unknown-unknown"
4+
5+
@vtable = linkonce_odr dso_local unnamed_addr addrspace(1) constant { [3 x ptr addrspace(4)] } { [3 x ptr addrspace(4)] [ptr addrspace(4) null, ptr addrspace(4) null, ptr addrspace(4) addrspacecast (ptr @foo to ptr addrspace(4))] }, align 8
6+
7+
; CHECK: @foo() #0 !sycl_used_aspects ![[#aspects:]]
8+
define linkonce_odr spir_func void @foo() #0 {
9+
entry:
10+
%tmp = alloca double
11+
ret void
12+
}
13+
14+
; CHECK-NOT: @construct({{.*}}){{.*}}!sycl_used_aspects
15+
define weak_odr dso_local spir_kernel void @construct(ptr addrspace(1) noundef align 8 %_arg_StorageAcc) {
16+
entry:
17+
store ptr addrspace(1) getelementptr inbounds inrange(-16, 8) (i8, ptr addrspace(1) @vtable, i64 16), ptr addrspace(1) %_arg_StorageAcc, align 8
18+
ret void
19+
}
20+
21+
; CHECK: ![[#aspects]] = !{i32 6}
22+
23+
attributes #0 = { "indirectly-callable"="set-foo" }
24+
25+
!sycl_aspects = !{!0}
26+
!0 = !{!"fp64", i32 6}

0 commit comments

Comments
 (0)