2012-11-13 03:12:12 +08:00
|
|
|
// RUN: %clang_cc1 %s -ast-print | FileCheck %s
|
2007-12-04 05:43:25 +08:00
|
|
|
|
|
|
|
typedef void func_typedef();
|
|
|
|
func_typedef xxx;
|
|
|
|
|
2007-12-07 01:20:20 +08:00
|
|
|
typedef void func_t(int x);
|
|
|
|
func_t a;
|
2007-12-04 05:43:25 +08:00
|
|
|
|
2012-11-13 03:12:12 +08:00
|
|
|
struct blah {
|
|
|
|
struct {
|
|
|
|
struct {
|
|
|
|
int b;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
int foo(const struct blah *b) {
|
|
|
|
// CHECK: return b->b;
|
|
|
|
return b->b;
|
|
|
|
}
|
2014-07-19 07:19:20 +08:00
|
|
|
|
|
|
|
int arr(int a[static 3]) {
|
|
|
|
// CHECK: int a[static 3]
|
|
|
|
return a[2];
|
|
|
|
}
|
|
|
|
|
2014-07-19 10:01:03 +08:00
|
|
|
int rarr(int a[restrict static 3]) {
|
|
|
|
// CHECK: int a[restrict static 3]
|
|
|
|
return a[2];
|
|
|
|
}
|
|
|
|
|
2014-07-19 07:19:20 +08:00
|
|
|
int varr(int n, int a[static n]) {
|
|
|
|
// CHECK: int a[static n]
|
|
|
|
return a[2];
|
|
|
|
}
|
|
|
|
|
2014-07-19 10:01:03 +08:00
|
|
|
int rvarr(int n, int a[restrict static n]) {
|
|
|
|
// CHECK: int a[restrict static n]
|
|
|
|
return a[2];
|
|
|
|
}
|
|
|
|
|
2014-08-01 21:49:00 +08:00
|
|
|
typedef struct {
|
|
|
|
int f;
|
|
|
|
} T __attribute__ ((__aligned__));
|
2014-09-16 00:45:30 +08:00
|
|
|
|
|
|
|
// CHECK: struct __attribute__((visibility("default"))) S;
|
|
|
|
struct __attribute__((visibility("default"))) S;
|
2015-05-29 06:19:36 +08:00
|
|
|
|
|
|
|
struct pair_t {
|
|
|
|
int a;
|
|
|
|
int b;
|
|
|
|
};
|
|
|
|
|
|
|
|
// CHECK: struct pair_t p = {a: 3, .b = 4};
|
|
|
|
struct pair_t p = {a: 3, .b = 4};
|
2016-01-25 18:34:06 +08:00
|
|
|
|
|
|
|
void initializers() {
|
|
|
|
// CHECK: int *x = ((void *)0), *y = ((void *)0);
|
|
|
|
int *x = ((void *)0), *y = ((void *)0);
|
|
|
|
struct Z{};
|
|
|
|
struct {
|
|
|
|
struct Z z;
|
|
|
|
// CHECK: } z = {(struct Z){}};
|
|
|
|
} z = {(struct Z){}};
|
|
|
|
}
|