1 // Test without serialization:
2 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -Wno-unused-value -std=gnu++17 \
3 // RUN: -ast-dump %s -ast-dump-filter Test \
4 // RUN: | FileCheck --strict-whitespace --match-full-lines %s
6 // Test with serialization:
7 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -Wno-unused-value -std=gnu++17 -emit-pch -o %t %s
8 // RUN: %clang_cc1 -x c++ -triple x86_64-unknown-unknown -Wno-unused-value -std=gnu++17 \
9 // RUN: -include-pch %t -ast-dump-all -ast-dump-filter Test /dev/null \
10 // RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \
11 // RUN: | FileCheck --strict-whitespace --match-full-lines %s
50 int i
= 1, j
= 2, k
= 3;
53 int a
= 4, b
= 5, c
= 6;
57 int arr0
[8] = {1, 2, 3, 4};
58 int arr1
[8] = {1, 2, 3, 4, 0, 0, 0, 0};
63 // CHECK: | `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} s0 'const S0' constexpr listinit
64 // CHECK-NEXT: | |-value: Struct
65 // CHECK-NEXT: | | `-fields: Int 0, Union .j Int 0
68 // CHECK: | `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} s1 'const S1' constexpr listinit
69 // CHECK-NEXT: | |-value: Struct
70 // CHECK-NEXT: | | |-field: Int 0
71 // CHECK-NEXT: | | `-field: Union .s
72 // CHECK-NEXT: | | `-Struct
73 // CHECK-NEXT: | | `-field: Int 0
76 // CHECK: | `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} s2 'const S2' constexpr listinit
77 // CHECK-NEXT: | |-value: Struct
78 // CHECK-NEXT: | | `-fields: Int 0, Union .u Union .j Int 0
81 // CHECK: | `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} s3 'const S3' constexpr listinit
82 // CHECK-NEXT: | |-value: Struct
83 // CHECK-NEXT: | | |-field: Int 0
84 // CHECK-NEXT: | | `-field: Union .u
85 // CHECK-NEXT: | | `-Union .j
86 // CHECK-NEXT: | | `-Struct
87 // CHECK-NEXT: | | `-field: Int 0
90 // CHECK: | `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} s4 'const S4' constexpr listinit
91 // CHECK-NEXT: | |-value: Struct
92 // CHECK-NEXT: | | |-base: Struct
93 // CHECK-NEXT: | | | `-fields: Int 0, Union .j Int 0
94 // CHECK-NEXT: | | |-fields: Int 1, Int 2, Int 3
95 // CHECK-NEXT: | | |-field: Struct
96 // CHECK-NEXT: | | `-fields: Int 4, Int 5, Int 6
99 // CHECK: `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} s5 'const S5' constexpr listinit
100 // CHECK-NEXT: |-value: Struct
101 // CHECK-NEXT: | |-base: Struct
102 // CHECK-NEXT: | | |-base: Struct
103 // CHECK-NEXT: | | | `-fields: Int 0, Union .j Int 0
104 // CHECK-NEXT: | | |-fields: Int 1, Int 2, Int 3
105 // CHECK-NEXT: | | |-field: Struct
106 // CHECK-NEXT: | | `-fields: Int 4, Int 5, Int 6
107 // CHECK-NEXT: | |-field: Array size=8
108 // CHECK-NEXT: | | |-elements: Int 1, Int 2, Int 3, Int 4
109 // CHECK-NEXT: | | `-filler: 4 x Int 0
110 // CHECK-NEXT: | `-field: Array size=8
111 // CHECK-NEXT: | |-elements: Int 1, Int 2, Int 3, Int 4
112 // CHECK-NEXT: | `-elements: Int 0, Int 0, Int 0, Int 0