[Clang/AMDGPU] Zero sized arrays not allowed in HIP device code. (#113470)
[llvm-project.git] / clang / test / Layout / dump-complete.cpp
blob728f133a0eb640aea115a6e32af3e3013c3e3f9c
1 // RUN: %clang_cc1 -fsyntax-only -fdump-record-layouts-complete %s | FileCheck %s
3 struct a {
4 int x;
5 };
7 struct b {
8 char y;
9 } foo;
11 class c {};
13 class d;
15 template <typename>
16 struct s {
17 int x;
20 template <typename T>
21 struct ts {
22 T x;
25 template <>
26 struct ts<void> {
27 float f;
30 void f() {
31 ts<int> a;
32 ts<double> b;
33 ts<void> c;
36 namespace gh83671 {
37 template <class _Tp, _Tp __v>
38 struct integral_constant {
39 static constexpr const _Tp value = __v;
40 typedef integral_constant type;
43 template <bool _Val>
44 using _BoolConstant = integral_constant<bool, _Val>;
46 template <class _Tp, class _Up>
47 struct is_same : _BoolConstant<__is_same(_Tp, _Up)> {};
49 template < class _Tp >
50 class numeric_limits {};
52 template < class _Tp >
53 class numeric_limits< const _Tp > : public numeric_limits< _Tp > {};
56 namespace gh83684 {
57 template <class Pointer>
58 struct AllocationResult {
59 Pointer ptr = nullptr;
60 int count = 0;
64 // CHECK: 0 | struct a
65 // CHECK: 0 | struct b
66 // CHECK: 0 | class c
67 // CHECK: 0 | struct ts<void>
68 // CHECK-NEXT: 0 | float
69 // CHECK: 0 | struct ts<int>
70 // CHECK: 0 | struct ts<double>
71 // CHECK-NOT: 0 | class d
72 // CHECK-NOT: 0 | struct s
73 // CHECK-NOT: 0 | struct AllocationResult