int dr004(void) {return 0;}
int dr004(void) {return 1;}
struct dr007_a;
struct dr007_a;
struct dr007_a {int a;};
struct dr007_a;
struct dr007_b {int a;};
struct dr007_b;
typedef int dr009_t;
void dr009_f((dr009_t));
typedef int dr010_t[];
dr010_t dr010_a = {1};
dr010_t dr010_b = {1, 2};
int dr010_c = sizeof(dr010_t);
static int dr011_a[];
void dr011(void) {
extern int i[];
{
extern int i[10];
(void)sizeof(i);
_Static_assert(sizeof(i) == 10 * sizeof(int), "fail");
}
(void)sizeof(i);
extern int dr011_a[10];
(void)sizeof(dr011_a);
_Static_assert(sizeof(dr011_a) == 10 * sizeof(int), "fail");
extern int j[10];
{
extern int j[];
(void)sizeof(j);
_Static_assert(sizeof(j) == 10 * sizeof(int), "fail");
}
}
void dr012(void *p) {
(void)&*p;
}
int dr013(int a[4]);
int dr013(int a[5]);
int dr013(int *a);
struct dr013_t {
struct dr013_t *p;
} dr013_v[sizeof(struct dr013_t)];
void dr015(void) {
struct S {
int small_int_bitfield : 16;
unsigned int small_uint_bitfield : 16;
int int_bitfield : 32;
unsigned int uint_bitfield : 32;
} s;
_Static_assert(__builtin_types_compatible_p(__typeof__(+s.small_int_bitfield), int), "fail");
_Static_assert(__builtin_types_compatible_p(__typeof__(+s.small_uint_bitfield), int), "fail");
_Static_assert(__builtin_types_compatible_p(__typeof__(+s.int_bitfield), int), "fail");
_Static_assert(__builtin_types_compatible_p(__typeof__(+s.uint_bitfield), unsigned int), "fail");
}
#define THIS$AND$THAT(a, b) ((a) + (b))
_Static_assert(THIS$AND$THAT(1, 1) == 2, "fail");
_Static_assert(__builtin_types_compatible_p(struct S { int a; }, union U { int a; }), "fail");
void dr031(int i) {
switch (i) {
case __INT_MAX__ + 1: break;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wswitch"
case __INT_MAX__ + 2ul: break;
#pragma clang diagnostic pop
case (__INT_MAX__ * 4) / 4: break;
}
}
int dr032 = (1, 2);
#if __STDC_VERSION__ < 202000L
void dr035_1(a, b)
int a(enum b {x, y});
int b; {
int test = x;
}
void dr035_2(c)
enum m{q, r} c; {
int test = q;
}
#endif
#define DR038_X 0x000E
#define DR038_Y 0x0100
#define DR038(a) a
_Static_assert(DR038(DR038_X + DR038_Y) == DR038_X + DR038_Y, "fail");
_Static_assert(sizeof('a') == sizeof(int), "fail");
struct dr040 {
char c;
short s;
int i[__builtin_offsetof(struct dr040, s)];
};
void dr043(void) {
#include <stddef.h>
(void)(void *)NULL;
NULL->a;
}
void dr044(void) {
#include <stddef.h>
struct S { int a, b; };
_Static_assert(offsetof(struct S, b) == sizeof(int), "fail");
}
typedef int dr046_t;
int dr046(int dr046_t) { return dr046_t; }
struct dr047_t;
struct dr047_t *dr047_1(struct dr047_t *p) {return p; }
struct dr047_t *dr047_2(struct dr047_t a[]) {return a; }
int *dr047_3(int a2[][]) {return *a2; }
extern struct dr047_t es1;
extern struct dr047_t es2[1];
void dr050(void) {
#undef NULL
(void)L"huttah!";
(void)NULL;
}
#if __STDC_VERSION__ < 202000L
void dr053(void) {
int f(int);
int (*fp1)(int);
int (*fp2)();
int (**fpp)();
fp1 = f;
fp2 = fp1;
(*fp2)(3);
fpp = &fp1;
(**fpp)(3);
}
#endif
char *dr064_1(int i, int *pi) {
*pi = i;
return 0;
}
char *dr064_2(int i, int *pi) {
return (*pi = i, 0);
}
void dr068(void) {
#include <limits.h>
#if CHAR_MAX == SCHAR_MAX
_Static_assert('\xFF' == -1, "fail");
#else
_Static_assert('\xFF' == 0xFF, "fail");
#endif
}
#if __STDC_VERSION__ < 202000L
void dr070_1(c)
int c; {
}
void dr070_2(void) {
dr070_1(6);
dr070_1(6U);
}
#endif
enum dr071_t { foo_A = 0, foo_B = 1, foo_C = 8 };
void dr071(void) {
_Static_assert(100 == (int)(enum dr071_t)100, "fail");
}
void dr081(void) {
_Static_assert(-1 << 1 == -2, "fail");
_Static_assert(1 << 3 == 1u << 3u, "fail");
}
struct dr084_t;
extern void (*dr084_1)(struct dr084_t);
void dr084_2(struct dr084_t);
void dr084_2(struct dr084_t val) {}
struct dr088_t_1;
void dr088_f(struct dr088_t_1 *);
void dr088_1(void) {
struct dr088_t_1;
dr088_f((struct dr088_t_1 *)0);
}
void dr088_2(struct dr088_t_1 *p) { }
struct dr088_t_1 { int i; };
void dr088_3(struct dr088_t_1 s) {
dr088_2(&s);
}
#define DR089 object_like
#define DR089(argument) function_like
void dr095(void) {
struct One {
int a;
} one;
struct Two {
float f;
} two = one;
two = one;
}
void dr096(void) {
typedef void func_type(void);
func_type array_funcs[10];
void array_void[10];
struct S;
struct S s[10];
union U;
union U u[10];
union U { int i; };
int never_completed_incomplete_array[][];
extern int completed_later[][];
extern int completed_later[10][10];
}
void dr098(void) {
typedef void func_type(void);
func_type fp;
struct incomplete *incomplete_ptr;
++fp;
fp++;
--fp;
fp--;
(*incomplete_ptr)++;
++(*incomplete_ptr);
(*incomplete_ptr)--;
--(*incomplete_ptr);
}