Skip to content

Commit 7b81485

Browse files
authored
[SYCL][Opaque pointer] Remove no opaque CodeGenSYCL tests (#10779)
We have finally switched the default to opaque pointer for SPIRV , so everything should be opaque pointer now. Most of these no-opaque* test have corresponding opaque pointer test, so I think we can remove them safely.
1 parent 6d952a6 commit 7b81485

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// RUN: %clang_cc1 -fsycl-is-device -triple spir64-unknown-unknown -emit-llvm -o - %s | FileCheck %s
2+
3+
// This test checks that clang emits @llvm.ptr.annotation intrinsic correctly
4+
// when attribute annotate is applied to a struct field of integer type.
5+
6+
// CHECK: private unnamed_addr addrspace(1) constant [8 x i8] c"v_ann_{{.}}\00", section "llvm.metadata"
7+
// CHECK: private unnamed_addr addrspace(1) constant [8 x i8] c"v_ann_{{.}}\00", section "llvm.metadata"
8+
// CHECK: private unnamed_addr addrspace(1) constant [8 x i8] c"w_ann_{{.}}\00", section "llvm.metadata"
9+
// CHECK: private unnamed_addr addrspace(1) constant [8 x i8] c"w_ann_{{.}}\00", section "llvm.metadata"
10+
// CHECK: private unnamed_addr addrspace(1) constant [8 x i8] c"f_ann_{{.}}\00", section "llvm.metadata"
11+
// CHECK: private unnamed_addr addrspace(1) constant [8 x i8] c"f_ann_{{.}}\00", section "llvm.metadata"
12+
13+
struct foo {
14+
int v __attribute__((annotate("v_ann_0"))) __attribute__((annotate("v_ann_1")));
15+
char w __attribute__((annotate("w_ann_0"))) __attribute__((annotate("w_ann_1")));
16+
float f __attribute__((annotate("f_ann_0"))) __attribute__((annotate("f_ann_1")));
17+
};
18+
19+
int __attribute__((sycl_device)) foo() {
20+
struct foo f;
21+
f.v = 1;
22+
// CHECK: getelementptr inbounds %struct.foo, ptr addrspace(4) %{{.*}}, i32 0, i32 0
23+
// CHECK-NEXT: call ptr addrspace(4) @llvm.ptr.annotation.p4.p1({{.*}}str{{.*}}str{{.*}}i32 14, ptr addrspace(1) null)
24+
// CHECK-NEXT: call ptr addrspace(4) @llvm.ptr.annotation.p4.p1({{.*}}str{{.*}}str{{.*}}i32 14, ptr addrspace(1) null)
25+
f.w = 42;
26+
// CHECK: getelementptr inbounds %struct.foo, ptr addrspace(4) %{{.*}}, i32 0, i32 1
27+
// CHECK-NEXT: call ptr addrspace(4) @llvm.ptr.annotation.p4.p1({{.*}}str{{.*}}str{{.*}}i32 15, ptr addrspace(1) null)
28+
// CHECK-NEXT: call ptr addrspace(4) @llvm.ptr.annotation.p4.p1({{.*}}str{{.*}}str{{.*}}i32 15, ptr addrspace(1) null)
29+
f.f = 0;
30+
// CHECK: getelementptr inbounds %struct.foo, ptr addrspace(4) %{{.*}}, i32 0, i32 2
31+
// CHECK-NEXT: call ptr addrspace(4) @llvm.ptr.annotation.p4.p1({{.*}}str{{.*}}str{{.*}}i32 16, ptr addrspace(1) null)
32+
// CHECK-NEXT: call ptr addrspace(4) @llvm.ptr.annotation.p4.p1({{.*}}str{{.*}}str{{.*}}i32 16, ptr addrspace(1) null)
33+
return 0;
34+
}

0 commit comments

Comments
 (0)