forked from intel/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathint_header_inline_ns.cpp
More file actions
73 lines (63 loc) · 1.88 KB
/
int_header_inline_ns.cpp
File metadata and controls
73 lines (63 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// RUN: %clang_cc1 -fsycl-is-device -fsycl-int-header=%t.h %s -o %t.out
// RUN: FileCheck -input-file=%t.h %s
// This test checks if the SYCL device compiler is able to generate correct
// integration header when the kernel name class is wrapped in an inline
// namespace.
#include "Inputs/sycl.hpp"
template <typename KernelName, typename KernelType>
__attribute__((sycl_kernel)) void kernel_single_task(const KernelType &kernelFunc) {
kernelFunc();
}
// Top-level inline namespace
// CHECK: inline namespace ns1 {
// CHECK-NEXT: class Foo11;
// CHECK-NEXT: }
// CHECK-NEXT: inline namespace ns1 {
// CHECK-NEXT: class Foo12;
// CHECK-NEXT: }
// CHECK-NEXT: inline namespace ns1 {
// CHECK-NEXT: class Foo13;
// CHECK-NEXT: }
inline namespace ns1 {
class Foo11 {};
class Foo12;
class Foo13 {};
} // namespace ns1
// Nested inline namespace
// CHECK-NEXT: namespace ns2 { inline namespace ns3 {
// CHECK-NEXT: class Foo21;
// CHECK-NEXT: }}
// CHECK-NEXT: namespace ns2 { inline namespace ns3 {
// CHECK-NEXT: class Foo22;
// CHECK-NEXT: }}
namespace ns2 {
inline namespace ns3 {
class Foo21 {};
class Foo22;
} // namespace ns3
} // namespace ns2
// Namespace nested inside nested inline namespace
// CHECK-NEXT: namespace ns4 { inline namespace ns5 { namespace ns6 {
// CHECK-NEXT: class Foo31;
// CHECK-NEXT: }}}
// CHECK-NEXT: namespace ns4 { inline namespace ns5 { namespace ns6 {
// CHECK-NEXT: class Foo32;
// CHECK-NEXT: }}}
namespace ns4 {
inline namespace ns5 {
namespace ns6 {
class Foo31 {};
class Foo32;
} // namespace ns6
} // namespace ns5
} // namespace ns4
int main() {
kernel_single_task<Foo11>([]() {});
kernel_single_task<::Foo12>([]() {});
kernel_single_task<ns1::Foo13>([]() {});
kernel_single_task<ns2::Foo21>([]() {});
kernel_single_task<ns2::ns3::Foo22>([]() {});
kernel_single_task<ns4::ns6::Foo31>([]() {});
kernel_single_task<ns4::ns5::ns6::Foo32>([]() {});
return 0;
}