Skip to content

Commit f2bfcb7

Browse files
committed
Enhance the test.
Signed-off-by: Eric Schweitz <eschweitz@nvidia.com>
1 parent 7003aa7 commit f2bfcb7

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

test/AST-Quake/cudaq_run.cpp

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ struct K9 {
2020
}
2121
};
2222

23+
__qpu__ bool kernel_of_truth() { return true; }
2324
__qpu__ int kernel_of_corn() { return 0xDeadBeef; }
2425

2526
class CliffDiver {
@@ -136,7 +137,17 @@ struct CliffHanger {
136137
// CHECK: return
137138
// CHECK: }
138139

139-
// CHECK-LABEL: func.func @__nvqpp__mlirgen__function_kernel_of_corn._Z14kernel_of_cornv() attributes {"cudaq-entrypoint", "cudaq-kernel", no_this} {
140+
// CHECK-LABEL: func.func @__nvqpp__mlirgen__function_kernel_of_truth.
141+
// CHECK-SAME: () attributes {"cudaq-entrypoint", "cudaq-kernel", no_this} {
142+
// CHECK: %[[VAL_0:.*]] = arith.constant true
143+
// CHECK: %[[VAL_1:.*]] = cc.string_literal "i1" : !cc.ptr<!cc.array<i8 x 3>>
144+
// CHECK: %[[VAL_2:.*]] = cc.cast %[[VAL_1]] : (!cc.ptr<!cc.array<i8 x 3>>) -> !cc.ptr<i8>
145+
// CHECK: call @__quantum__rt__bool_record_output(%[[VAL_0]], %[[VAL_2]]) : (i1, !cc.ptr<i8>) -> ()
146+
// CHECK: return
147+
// CHECK: }
148+
149+
// CHECK-LABEL: func.func @__nvqpp__mlirgen__function_kernel_of_corn.
150+
// CHECK-SAME: () attributes {"cudaq-entrypoint", "cudaq-kernel", no_this} {
140151
// CHECK: %[[VAL_0:.*]] = arith.constant -559038737 : i64
141152
// CHECK: %[[VAL_1:.*]] = cc.string_literal "i32" : !cc.ptr<!cc.array<i8 x 4>>
142153
// CHECK: %[[VAL_2:.*]] = cc.cast %[[VAL_1]] : (!cc.ptr<!cc.array<i8 x 4>>) -> !cc.ptr<i8>
@@ -152,7 +163,8 @@ struct CliffHanger {
152163
// CHECK: return
153164
// CHECK: }
154165

155-
// CHECK-LABEL: func.func @__nvqpp__mlirgen__function_kernel_of_wheat._Z15kernel_of_wheatv() attributes {"cudaq-entrypoint", "cudaq-kernel", no_this} {
166+
// CHECK-LABEL: func.func @__nvqpp__mlirgen__function_kernel_of_wheat.
167+
// CHECK-SAME: () attributes {"cudaq-entrypoint", "cudaq-kernel", no_this} {
156168
// CHECK: %[[VAL_0:.*]] = arith.constant 13.100000381469727 : f64
157169
// CHECK: %[[VAL_1:.*]] = cc.string_literal "f32" : !cc.ptr<!cc.array<i8 x 4>>
158170
// CHECK: %[[VAL_2:.*]] = cc.cast %[[VAL_1]] : (!cc.ptr<!cc.array<i8 x 4>>) -> !cc.ptr<i8>
@@ -168,15 +180,17 @@ struct CliffHanger {
168180
// CHECK: return
169181
// CHECK: }
170182

171-
// CHECK-LABEL: func.func @__nvqpp__mlirgen__function_this_is_not_a_drill._Z19this_is_not_a_drillv() attributes {"cudaq-entrypoint", "cudaq-kernel", no_this} {
183+
// CHECK-LABEL: func.func @__nvqpp__mlirgen__function_this_is_not_a_drill.
184+
// CHECK-SAME: () attributes {"cudaq-entrypoint", "cudaq-kernel", no_this} {
172185
// CHECK: %[[VAL_0:.*]] = arith.constant 123400000 : i64
173186
// CHECK: %[[VAL_1:.*]] = cc.string_literal "i64" : !cc.ptr<!cc.array<i8 x 4>>
174187
// CHECK: %[[VAL_2:.*]] = cc.cast %[[VAL_1]] : (!cc.ptr<!cc.array<i8 x 4>>) -> !cc.ptr<i8>
175188
// CHECK: call @__quantum__rt__integer_record_output(%[[VAL_0]], %[[VAL_2]]) : (i64, !cc.ptr<i8>) -> ()
176189
// CHECK: return
177190
// CHECK: }
178191

179-
// CHECK-LABEL: func.func @__nvqpp__mlirgen__function_this_is_a_hammer._Z16this_is_a_hammerv() attributes {"cudaq-entrypoint", "cudaq-kernel", no_this} {
192+
// CHECK-LABEL: func.func @__nvqpp__mlirgen__function_this_is_a_hammer.
193+
// CHECK-SAME: () attributes {"cudaq-entrypoint", "cudaq-kernel", no_this} {
180194
// CHECK: %[[VAL_0:.*]] = arith.constant 2387 : i64
181195
// CHECK: %[[VAL_1:.*]] = cc.string_literal "i16" : !cc.ptr<!cc.array<i8 x 4>>
182196
// CHECK: %[[VAL_2:.*]] = cc.cast %[[VAL_1]] : (!cc.ptr<!cc.array<i8 x 4>>) -> !cc.ptr<i8>

0 commit comments

Comments
 (0)