33#define PARAM_1 1U << 7
44#define PARAM_2 1U << 8
55
6+ // This test checks that using of __builtin_intel_fpga_mem results in correct
7+ // generation of annotations in LLVM IR.
8+
69// CHECK: [[STRUCT:%.*]] = type { i32, float }
710struct State {
811 int x;
@@ -14,7 +17,7 @@ struct State {
1417// CHECK: [[ANN3:@.str[\.]*[0-9]*]] = {{.*}}{params:384}{cache-size:127}{anchor-id:10}{target-anchor:20}{type:30}{cycle:40}
1518// CHECK: [[ANN4:@.str[\.]*[0-9]*]] = {{.*}}{params:384}{cache-size:127}{anchor-id:11}{target-anchor:12}{type:0}{cycle:0}
1619// CHECK: [[ANN5:@.str[\.]*[0-9]*]] = {{.*}}{params:384}{cache-size:127}{anchor-id:100}{target-anchor:0}{type:0}{cycle:0}
17- // CHECK: [[ANN6:@.str[\.]*[0-9]*]] = {{.*}}{params:384}{cache-size:128}{anchor-id:4}{target-anchor:5 }{type:6 }{cycle:0}
20+ // CHECK: [[ANN6:@.str[\.]*[0-9]*]] = {{.*}}{params:384}{cache-size:128}{anchor-id:4}{target-anchor:7 }{type:8 }{cycle:0}
1821
1922// CHECK: define {{.*}}spir_func void @{{.*}}(float addrspace(4)* %A, i32 addrspace(4)* %B, [[STRUCT]] addrspace(4)* %C, [[STRUCT]] addrspace(4)*{{.*}}%D)
2023void foo (float *A, int *B, State *C, State &D) {
@@ -85,10 +88,13 @@ void foo(float *A, int *B, State *C, State &D) {
8588 // CHECK-DAG: store i32 addrspace(4)* [[PTR11]], i32 addrspace(4)* addrspace(4)* %y
8689 y = __builtin_intel_fpga_mem (B, PARAM_1 | PARAM_2, 127 , 100 );
8790
91+ constexpr TestVal1 = 7 ;
92+ constexpr TestVal2 = 8 ;
93+
8894 // CHECK-DAG: [[D1:%[0-9]+]] = load [[STRUCT]] addrspace(4)*, [[STRUCT]] addrspace(4)* addrspace(4)* [[Daddr]]
8995 // CHECK-DAG: [[PTR12:%[0-9]+]] = call [[STRUCT]] addrspace(4)* @llvm.ptr.annotation{{.*}}[[D1]]{{.*}}[[ANN6]]{{.*}}[[ATT:#[0-9]+]]
9096 // CHECK-DAG: store [[STRUCT]] addrspace(4)* [[PTR12]], [[STRUCT]] addrspace(4)* addrspace(4)* %z
91- z = __builtin_intel_fpga_mem (&D, PARAM_1 | PARAM_2, 128 , 4 , 5 , 6 );
97+ z = __builtin_intel_fpga_mem (&D, PARAM_1 | PARAM_2, 128 , 4 , TestVal1, TestVal2 );
9298}
9399
94100// CHECK-DAG: attributes [[ATT]] = { readnone }
0 commit comments