Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions sycl/test/abi/layout_compile_time_kernel_info.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// RUN: %clangxx -fsycl -c -fno-color-diagnostics -Xclang -fdump-record-layouts %s -o %t.out | FileCheck %s
// REQUIRES: linux
// UNSUPPORTED: libcxx
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I take that line from other layout tests. I guess it is a common restriction, but I have not verified by myself.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I understood, #2731 disables all ABI tests with libcxx.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, that's quite old one and Nick had to fix the build since then. I think that PR disabled the tests because those classes were using std::something as members, which is not the case for CompileTimeKernelInfoTy. However, if other classes don't run, then there is little value in testing this one.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't investigate anything but in general the libcxx abi is totally different than libstdc++ (like the names of all the internal data structures), so we would need to write a seperate test for libcxx, but just disabling it is fine since the libstdc++ version should catch any problems.


// clang-format off

#include <sycl/detail/compile_time_kernel_info.hpp>

void foo(sycl::detail::compile_time_kernel_info_v1::CompileTimeKernelInfoTy) {}

// CHECK: 0 | struct sycl::detail::CompileTimeKernelInfoTy
// CHECK: 0 | class sycl::detail::string_view Name
// CHECK-NEXT: 0 | const char * str
// CHECK-NEXT: 8 | unsigned int NumParams
// CHECK-NEXT: 12 | _Bool IsESIMD
// CHECK-NEXT: 16 | class sycl::detail::string_view FileName
// CHECK-NEXT: 16 | const char * str
// CHECK-NEXT: 24 | class sycl::detail::string_view FunctionName
// CHECK-NEXT: 24 | const char * str
// CHECK-NEXT: 32 | unsigned int LineNumber
// CHECK-NEXT: 36 | unsigned int ColumnNumber
// CHECK-NEXT: 40 | int64_t KernelSize
// CHECK-NEXT: 48 | ParamDescGetterT ParamDescGetter
// CHECK-NEXT: 56 | _Bool HasSpecialCaptures
// CHECK-NEXT: | [sizeof=64, dsize=57, align=8,
// CHECK-NEXT: | nvsize=57, nvalign=8]