Skip to content

Commit 76a77f4

Browse files
committed
Add Functor test case
1 parent 190a44d commit 76a77f4

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

clang/test/CodeGenSYCL/code_location.cpp

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,3 +264,45 @@ int test5() {
264264
// CHECK: #endif
265265
// CHECK: }
266266
// CHECK: };
267+
268+
// Check that the location information returned is that of the Functor
269+
struct Functor {
270+
void operator()() const {
271+
}
272+
};
273+
int test6() {
274+
Functor F;
275+
cl::sycl::queue q;
276+
q.submit([=](cl::sycl::handler &h) { h.single_task<class KernelName6>(F); });
277+
return 0;
278+
}
279+
// CHECK: template <> struct KernelInfo<KernelName6> {
280+
// CHECK: static constexpr const char* getFileName() {
281+
// CHECK: #ifndef NDEBUG
282+
// CHECK: return "code_location.cpp";
283+
// CHECK: #else
284+
// CHECK: return "";
285+
// CHECK: #endif
286+
// CHECK: }
287+
// CHECK: static constexpr const char* getFunctionName() {
288+
// CHECK: #ifndef NDEBUG
289+
// CHECK: return "KernelName6";
290+
// CHECK: #else
291+
// CHECK: return "";
292+
// CHECK: #endif
293+
// CHECK: }
294+
// CHECK: static constexpr unsigned getLineNumber() {
295+
// CHECK: #ifndef NDEBUG
296+
// CHECK: return 269;
297+
// CHECK: #else
298+
// CHECK: return 0;
299+
// CHECK: #endif
300+
// CHECK: }
301+
// CHECK: static constexpr unsigned getColumnNumber() {
302+
// CHECK: #ifndef NDEBUG
303+
// CHECK: return 8;
304+
// CHECK: #else
305+
// CHECK: return 0;
306+
// CHECK: #endif
307+
// CHECK: }
308+
// CHECK: };

0 commit comments

Comments
 (0)