1 // RUN: %clang_cc1 %s -ast-print | FileCheck %s
2 // RUN: %clang_cc1 %s -ast-print | %clang_cc1 -fsyntax-only -
3
4 typedef void func_typedef();
5 func_typedef xxx;
6
7 typedef void func_t(int x);
8 func_t a;
9
10 struct blah {
11 struct {
12 struct {
13 int b;
14 };
15 };
16 };
17
foo(const struct blah * b)18 int foo(const struct blah *b) {
19 // CHECK: return b->b;
20 return b->b;
21 }
22
arr(int a[static3])23 int arr(int a[static 3]) {
24 // CHECK: int a[static 3]
25 return a[2];
26 }
27
rarr(int a[restrict static3])28 int rarr(int a[restrict static 3]) {
29 // CHECK: int a[restrict static 3]
30 return a[2];
31 }
32
varr(int n,int a[static n])33 int varr(int n, int a[static n]) {
34 // CHECK: int a[static n]
35 return a[2];
36 }
37
rvarr(int n,int a[restrict static n])38 int rvarr(int n, int a[restrict static n]) {
39 // CHECK: int a[restrict static n]
40 return a[2];
41 }
42
43 // CHECK: typedef struct {
44 typedef struct {
45 int f;
46 } T __attribute__ ((__aligned__));
47
48 // CHECK: struct __attribute__((visibility("default"))) S;
49 struct __attribute__((visibility("default"))) S;
50
51 struct pair_t {
52 int a;
53 int b;
54 };
55
56 // CHECK: struct pair_t p = {a: 3, .b = 4};
57 struct pair_t p = {a: 3, .b = 4};
58
initializers()59 void initializers() {
60 // CHECK: int *x = ((void *)0), *y = ((void *)0);
61 int *x = ((void *)0), *y = ((void *)0);
62 struct Z{};
63 struct {
64 struct Z z;
65 // CHECK: } z = {(struct Z){}};
66 } z = {(struct Z){}};
67 }
68