+++ /dev/null
-#include "declspec.h"
-
-int test2(void) {
- return 0;
-}
-
-int __declspec(align(4)) x;
-
-int __declspec(dllimport) y;
-int __declspec(dllexport, align(4)) z;
-
-int __declspec(noinline, naked, deprecated("Mist"))func(void)
-{
- return 42;
-}
-
-struct x {
- int __declspec(property(get=get_a, put=put_a)) a;
-};
-
-__declspec(restrict) char * malloc_like();
-int __declspec(noalias) test1(void *a, void *b);
-
-void test3(void) {
- test2();
- func();
-}
-
-__declspec(deprecated) int (*ptr)(void) = ****test2;
-
-int main(void) {
- int x = ptr();
- printf("%I64d\n", x);
- return x;
-}
+++ /dev/null
-__declspec(deprecated) int test2(void);
+++ /dev/null
-extern int puts(const char *s);
-
-const char *test1(void) {
- return __func__;
-}
-
-const char *test2(void) {
- return __FUNCTION__;
-}
-
-const char *test3(void) {
- return __FUNCSIG__;
-}
-
-const char *test4(void) {
- return __FUNCDNAME__;
-}
-
-int main(void) {
- puts(test1());
- puts(test2());
- puts(test3());
- puts(test4());
-}
+++ /dev/null
-int printf(const char *str, ...);
-
-__int8 blup = 42;
-signed __int8 blup2 = 43;
-unsigned __int8 blup3 = 44;
-__int64 blup4 = 0xfffffff00000045;
-unsigned __int64 blup5 = 0xffffffff00000045;
-
-int main(void)
-{
- printf("%d %d %u %I64d %I64u\n", blup, blup2, blup3, blup4, blup5);
-}
+++ /dev/null
-int test(int a, int b) {
- __noop(a+b, a, b);
- return 0;
-}
+++ /dev/null
-int test(int a, int b) {
- __try {
- a = a / b;
- }
- if(0) {
- a = 0;
- }
-}
-
-int main(int argc, char *argv[]) {
- int x;
- __try {
- x = argc / 0;
- }
- __finally {
- printf("Should always print this!\n");
- }
- return 0;
-}
+++ /dev/null
-int printf(const char *str, ...);
-
-int main(void)
-{
- int array[4];
- unsigned st = sizeof(array + 1);
- printf("Res: %d %d %d %d (should be 4, 16, 16, 16 if sizeof(int)==4)\n",
- (int) sizeof(array+1), (int) sizeof(array),
- (int) sizeof(*&array), (int) sizeof( (array) ));
- return 0;
-}
+++ /dev/null
-int printf(const char *str, ...);
-
-int main(void) {
- struct {
- int a : 8;
- int b : 12;
- } s;
-
- s.b = 0xff;
- s.a = 0;
- s.a += 20;
- s.a /= 2;
- s.a %= 4;
- s.a -= 12;
- s.a++;
- s.b--;
- printf("%d %d\n", s.a, s.b);
- return 0;
-}
+++ /dev/null
-struct x {
- unsigned x1:1;
- unsigned x2:2;
- unsigned x3:3;
- unsigned x4:4;
-};
-
-void foobar (int x, int y, int z)
-{
- struct x a = {x, y, z, 7};
- struct x b = {x, y, z, 3};
- struct x *c = &b;
-
- c->x3 += (a.x2 - a.x1) * c->x2;
- if (a.x1 != 1 || c->x3 != 5)
- abort ();
- exit (0);
-}
-
-int main()
-{
- foobar (1, 2, 3);
-}
+++ /dev/null
-int puts(const char *str);
-
-struct bla {
- int a;
- float b;
- char c[20];
-};
-
-int main(void)
-{
- struct bla a;
- a = (struct bla) { 4, 5.2, "Hello" };
- puts(a.c);
- return 0;
-}
+++ /dev/null
-int gk = sizeof( (int[]) { 1, 2, 3 } ) / sizeof(int);
-
-int main(void) {
- int k = sizeof( (int[]) { 1, 2, 3 } ) / sizeof(int);
-
- if(k != 3)
- return 1;
-
- return 0;
-}
+++ /dev/null
-int a, b, c;
-
-typedef struct S {
- int k[3];
- struct lku {
- double d, e;
- } elem;
-} S;
-S kg;
-
-int main(void) {
- S k = { a, b };
-
- kg = k;
-
- return 0;
-}
+++ /dev/null
-typedef float vec3_t[3];
-
-void f(const vec3_t foo) {
-}
-
-int main(void) {
- const float *bla = 0;
- f(bla);
- return 0;
-}
+++ /dev/null
-int k;
-
-enum ENUM {
- bla = 2 < 4 ? 0 : k
-};
-
-int main(void)
-{
- return bla;
-}
+++ /dev/null
-struct foo {
- int a;
- int b;
-};
-struct foo bar = { (int) &((struct foo*)0)->b, 0 };
-
-int main(void) {
- return 0;
-}
+++ /dev/null
-typedef struct {
- int trTime;
- float vec[3];
-} trajectory_t;
-
-typedef struct {
- trajectory_t pos;
-} entityState_t;
-
-typedef struct {
- char *name;
- int offset;
- int bits; // 0 = float
-} netField_t;
-
-#define NETF(x) #x,(unsigned)&((entityState_t*)0)->x
-
-netField_t entityStateFields[] =
-{
- { NETF(pos.vec[0]), 32 },
-};
-
-int main(void) {
- return 0;
-}
+++ /dev/null
-int qftol(void) {
- return 0;
-}
-
-static int ftolPtr = (int) qftol;
-
-int main(void) {
- return 0;
-}
+++ /dev/null
-int k[1024 / (8 * sizeof(unsigned long))];
-
-int main(void)
-{
- return 0;
-}
+++ /dev/null
-void bi_windup(void);
-
-void bi_windup();
-
-void bi_windup() {
-}
-
-int main(void)
-{
- return 0;
-}
+++ /dev/null
-int *a;
-int b = 0;
-int *a = &b;
-
-int main(void)
-{
- return *a;
-}
+++ /dev/null
-extern char ofname[];
-char ofname[1024];
-char ofname[];
-
-int main(void)
-{
- return sizeof(ofname) != 1024;
-}
+++ /dev/null
-typedef struct arc
-{
- struct arc *nextout, *nextin;
- long ident;
-} arc_t;
-
-struct arc k;
-arc_t l;
-
-int main(void)
-{
- k = l;
- return 0;
-}
+++ /dev/null
-struct Bla {
- struct arc *ptr;
-};
-
-typedef struct arc
-{
- struct Bla bla;
-} arc_t;
-
-struct arc k;
-
-int main(void)
-{
- k.bla.ptr = &k;
- k.bla.ptr->bla.ptr = &k;
-
- return 0;
-}
+++ /dev/null
-int FirstOne(long long arg1)
-{
- union doub {
- unsigned short i[4];
- long long d;
- };
-
- union doub x;
- x.d = arg1;
- return x.i[2];
-}
-
-int main(void)
-{
- return FirstOne(0);
-}
+++ /dev/null
-char str[] = { "Hallo" };
-
-int main(void) {
- puts(str);
- return 0;
-}
+++ /dev/null
-int init_r90[64]
-= { 56, 48, 40, 32, 24, 16, 8, 0,
- 57, 49, 41, 33, 25, 17, 9, 1,
- 58, 50, 42, 34, 26, 18, 10, 2,
- 59, 51, 43, 35, 27, 19, 11, 3,
- 60, 52, 44, 36, 28, 20, 12, 4,
- 61, 53, 45, 37, 29, 21, 13, 5,
- 62, 54, 46, 38, 30, 22, 14, 6,
- 63, 55, 47, 39, 31, 23, 15, 7 };
-
-int main(void)
-{
- return 0;
-}
+++ /dev/null
-struct bla { int a; };
-void g(const struct bla);
-void h(struct bla);
-void f(void)
-{
- const struct bla x = { 0 };
-}
-
-int main(void) {
- return 0;
-}
+++ /dev/null
-typedef unsigned id;
-
-int main(void) {
- unsigned int id = 0;
-
- return 0;
-}
+++ /dev/null
-int a[1][1] = { { 42 } };
-
-int main(void)
-{
- return a[0][0] - 42;
-}
+++ /dev/null
-extern void (*var) (void);
-
-extern void puts(void);
-
-void (*var) (void) = puts;
-
-int main(void)
-{
- return 0;
-}
+++ /dev/null
-
-typedef struct Person {
- int bla;
-} Person;
-
-int f(void) {
- Person *Person;
-}
-
-int bla(Person *p) {
- return p->bla;
-}
-
-int main(void)
-{
- Person p = { 0 };
- return bla(&p);
-}
+++ /dev/null
-int main(void) {
- void (*var)(void);
-
- var = (void (*)(void)) 0;
-
- return (int) var;
-}
+++ /dev/null
-int puts(const char *msg);
-
-int main(int argc, char **argv)
-{
- void *nu = 0;
- char *arg1 = argc > 1 ? argv[1] : 0;
- char *arg2 = argc <= 1 ? 0 : argv[1];
- char *arg3 = argc > 1 ? argv[1] : nu;
- char *arg4 = argc <= 1 ? nu : argv[1];
-
- int blo = (int) (argc < 100 ? 0 : argv[1]);
-
- if(arg1 != 0) {
- puts(arg1);
- puts(arg2);
- puts(arg3);
- puts(arg4);
- }
-
- return blo;
-}
+++ /dev/null
-int main(void)
-{
- enum MYBOOL { FALSE, TRUE };
-
- enum MYBOOL k = FALSE;
-
- return k;
-}
+++ /dev/null
-typedef enum {
- TYPE_QUALIFIER_NONE = 0,
- TYPE_QUALIFIER_CONST = 1 << 0,
- TYPE_QUALIFIER_RESTRICT = 1 << 1,
- TYPE_QUALIFIER_VOLATILE = 1 << 2,
-} type_qualifier_t;
-
-typedef unsigned int type_qualifiers_t;
-
-typedef struct source_position_t source_position_t;
-struct source_position_t {
- const char *input_name;
- unsigned linenr;
-};
-
-typedef struct ir_type ir_type;
-
-typedef enum {
- TYPE_INVALID,
- TYPE_ERROR,
- TYPE_ATOMIC,
-} type_kind_t;
-
-struct type_base_t {
- type_kind_t kind;
- type_qualifiers_t qualifiers;
- source_position_t source_position;
-
- ir_type *firm_type;
-};
-typedef struct type_base_t type_base_t;
-
-#define NULL (void*)0
-
-int main(void)
-{
- static const type_base_t error = { TYPE_ERROR, TYPE_QUALIFIER_NONE, { NULL, 0 }, NULL };
- return 0;
-}
+++ /dev/null
-
-int main(void) {
- int arr[] = { [4] = 2, };
-
- return 0;
-}
+++ /dev/null
-typedef struct {
- const char *string;
-} symbol_t;
-
-typedef struct {
- int type;
- union {
- symbol_t *symbol;
- long long blo;
- } v;
-} token_t;
-
-int main(void)
-{
- if(__builtin_offsetof(token_t, v.symbol) != sizeof(int))
- return 1;
- return 0;
-}
+++ /dev/null
-int main(void)
-{
- if(sizeof("-o") != 3)
- return 1;
-
- return 0;
-}
+++ /dev/null
-static void foo(void);
-
-int main(void)
-{
- return 0;
-}
+++ /dev/null
-/* fmt and all further parameters must be passed on the stack even for regparams */
-#include <stdio.h>
-#include <stdarg.h>
-
-static void f(const char* fmt, ...)
-{
- va_list va;
- va_start(va, fmt);
- vprintf(fmt, va);
- va_end(va);
-}
-
-
-int main(void)
-{
- f("Hallo, %s!\n", "Welt");
- return 0;
-}
+++ /dev/null
-/* Frontend assert while building initialisers */
-
-union {
- int i;
- char a[4];
-} blub = {
- .a[2] = 9,
- .i = 23
-};
-
-int main()
-{
- return 0;
-}
+++ /dev/null
-__extension__ typedef signed long long int __int64_t;
-__extension__ typedef unsigned long long int __uint64_t;
-
-int main(void) {
- __int64_t i = 0;
- return i;
-}
+++ /dev/null
-int printf(const char *fmt, ...);
-
-int main(void)
-{
- printf("Res: %d\n", (int) '\377');
- return 0;
-}
+++ /dev/null
-static int test(int a, int b);
-
-static int adr(int *x);
-
-static int test1(int a, int b) {
- return test(a,b);
-}
-
-static int test2(int a, int b) {
- int arr[2];
-
- arr[0] = a;
- arr[1] = b;
-
- adr(arr);
- return arr[0] + arr[1];
-}
-
-int main(void)
-{
- return 0;
-}
+++ /dev/null
-int foo();
-
-int kaputt(void) {
- return foo(42, 2, 3);
-}
-
-int foo(int a) {
- return a;
-}
-
-int main(void) {
- return kaputt() != 42;
-}
+++ /dev/null
-int printf(const char *str, ...);
-
-int main(void) {
- printf("%d\n", (int) sizeof (const void*));
- return 0;
-}
+++ /dev/null
-struct A {
- int a, b;
-};
-
-static struct A deduce_conversion(int from, int to)
-{
- struct A result = { 1, 2 };
- return result;
-}
-
-struct A globa_real;
-struct A *globa = &globa_real;
-
-int main(int argc, char **argv)
-{
- *globa = deduce_conversion(1, 2);
- return 0;
-}
+++ /dev/null
-typedef struct atomic_type_properties_t atomic_type_properties_t;
-struct atomic_type_properties_t {
- unsigned size; /**< type size in bytes */
-};
-
-enum atomic_types {
- ATOMIC_TYPE_VOID = 0,
- ATOMIC_TYPE_CHAR,
- ATOMIC_TYPE_LAST = ATOMIC_TYPE_CHAR
-};
-
-static atomic_type_properties_t atomic_type_properties[ATOMIC_TYPE_LAST+1] = {
- [ATOMIC_TYPE_CHAR] = {
- .size = 1,
- },
- [ATOMIC_TYPE_VOID] = {
- .size = 0,
- },
-};
-
-int main(void)
-{
- return atomic_type_properties[ATOMIC_TYPE_CHAR].size != 1;
-}
+++ /dev/null
-int printf(const char *str, ...);
-
-int printpass(int x) {
- printf("Val: %d\n", x);
- return x;
-}
-
-int f(int g) {
- int k = g * 2;
-
- printf ("pass1\n");
-
- int arr[printpass(k)];
- printf ("pass2: %zd\n", sizeof(arr));
- return 0;
-}
-
-int main(void) {
- return f(10);
-}
+++ /dev/null
-static void f(void) {
-}
-
-void (*ptr)(void);
-
-void init(void) {
- ptr = f;
-}
-
-int main(void)
-{
- return 0;
-}
+++ /dev/null
-extern __inline__ unsigned int ntohl(unsigned int);
-__inline__ unsigned int ntohl2(unsigned int);
-static __inline__ unsigned int ntohl3(unsigned int);
-
-extern __inline__ unsigned int xntohl(unsigned int a) { return 1; }
-__inline__ unsigned int xntohl2(unsigned int a) { return 2; }
-static __inline__ unsigned int xntohl3(unsigned int a) { return 3; }
-
-// only xntohl2 should be globally visible
-// the others should not even exist in the object file
-
-int main(void)
-{
- return 0;
-}
+++ /dev/null
-typedef void(__attribute__((__stdcall__)) *callback)(void);
-
-int main(void)
-{
- return 0;
-}
+++ /dev/null
-#pragma pack(push,2)
-typedef struct teststruct {
- char a;
- int b;
-} teststruct_t;
-#pragma pack(pop)
-
-typedef struct teststruct2 {
- char a;
- int b;
-} teststruct2_t;
-
-int main(void)
-{
- struct teststruct t;
- struct teststruct2 t2;
-
- memset(&t, 0, sizeof(t));
- t.a = 0xEF;
- t.b = 0x12345678;
-
- memset(&t2, 0, sizeof(t2));
- t2.a = 0xEF;
- t2.b = 0x12345678;
-
- printf("%.8X %.2X %.8X %.2X\n", *(unsigned int *) &t,
- (unsigned int) *((unsigned char *) &t + 4),
- *(unsigned int *) &t2,
- (unsigned int) *((unsigned char *) &t2 + 4));
-
- return 0;
-}
+++ /dev/null
-long ret42(void)
-{
- long retval;
- __asm__("movl $42, %0" : "=m" (retval));
- return retval;
-}
-
-int main(void)
-{
- return ret42() != 42;
-}
+++ /dev/null
-enum pr_opcode_e {
- blub
-};
-
-struct statement_s {
- enum pr_opcode_e op:16;
-};
-
-int main(void)
-{
- return sizeof(struct statement_s) == 0;
-}
+++ /dev/null
-static int f(void);
-
-int f(void) {
- return 42;
-}
-
-static int f(void);
-
-int main(void)
-{
- return f() != 42;
-}
+++ /dev/null
-unsigned char digest[16] = {""};
-unsigned char digest2[16] = {"a"};
-int puts(const char *str);
-
-int main(void)
-{
- puts((const char*) digest);
- puts((const char*) digest2);
- return 0;
-}
+++ /dev/null
-typedef void ALvoid;
-
-int f(ALvoid);
-
-int main(void)
-{
- return 0;
-}
+++ /dev/null
-static const struct {
- unsigned int width;
- unsigned int height;
- unsigned int bytes_per_pixel;
- unsigned char pixel_data[1 * 1 * 4 + 1];
-} ICON = {
- 1, 1, 4, "\0\0\0\0\0"
-};
-
-int main(void)
-{
- return ICON.width - 1;
-}
+++ /dev/null
-struct S { int x; };
-
-int main(void)
-{
- struct S { char y; };
- return 0;
-}
+++ /dev/null
-static void f(void) {}
-static void g(void p(void)) {}
-
-int main(void)
-{
- g(f);
- return 0;
-}
+++ /dev/null
-int main(void)
-{
- return 0;
- if (0) {}
-}
+++ /dev/null
-int main(void)
-{
- // This is sizeof of a compound literal, not sizeof a type followed by garbage
- return sizeof(int[]){ 0, 1, 2 } != 3*sizeof(int);
-}
+++ /dev/null
-int f(void)
-{
- return 42;
-}
-
-int (* const (fip) (void))(void)
-{
- return &f;
-}
-
-int main(void) {
- int(*func)(void);
- func = fip();
- return func() == 42 ? 0 : 1;
-}
+++ /dev/null
-#include <stdio.h>
-
-int a() {
- return 1;
-}
-
-int b() {
- return 2;
-}
-
-int c() {
- return 3;
-}
-
-int main(void)
-{
- int arr[] = { [1] = a(), [0] = b(), [1] = c(), [2] = a() };
- int size = sizeof(arr) / sizeof(arr[0]);
-
- printf("Size: %d\n", size);
-
- for(int i = 0; i < size; ++i) {
- printf("%d ", arr[i]);
- }
- printf("\n");
-
- return 0;
-}
+++ /dev/null
-#include <assert.h>
-
-typedef struct blub {
- int i;
- char a[4];
-} blub;
-
-blub a = { .a[2] = 2, 3, .i = 23 };
-
-int main(void)
-{
- assert(a.a[2] == 2);
- assert(a.a[3] == 3);
- return 0;
-}
+++ /dev/null
-#include <wchar.h>
-
-int main(void) {
- wprintf(L"Ha" L"llo");
- return 0;
-}
+++ /dev/null
-int main() {
- ;
- return 0;
-}
+++ /dev/null
-int main(int argc, char *argv[]) {
- enum { A, B, C } a = argc;
- (void) argv;
-
- return a != B;
-}
+++ /dev/null
-extern int puts(const char *s);
-
-const char *test1(void) {
- return __func__;
-}
-
-const char *test2(void) {
- return __FUNCTION__;
-}
-
-#ifdef __GNUC__
-const char *test3(void) {
- return __PRETTY_FUNCTION__;
-}
-#endif
-
-int main(void) {
- puts(test1());
- puts(test2());
-#ifdef __GNUC__
- puts(test3());
-#endif
-}
+++ /dev/null
-typedef void foo;
-
-foo function(foo)
-{
-}
-
-int main(void)
-{
- function();
- return 0;
-}
+++ /dev/null
-int printf(const char *str, ...);
-
-typedef struct {
- struct {
- union {
- int a;
- double b;
- };
- struct {
- float c;
- int k;
- };
- } v;
-
- int l;
-} bla;
-
-bla bl;
-
-int main(void)
-{
-
- bl.v.a = 12;
- bl.l = 32;
- bl.v.c = 23.4;
-
- printf("%d\n", (char*)&bl.v.c - (char*)&bl);
-
- return 0;
-}
+++ /dev/null
-int foo asm ("myfoo") = 0;
-
-extern func () asm ("FUNC");
-
-int func(int x) {
- return x;
-}
-
-int main(int argc, char *argv[]) {
- return func(foo);
-}
+++ /dev/null
-int test1(int a) __attribute__((noreturn));
-int test2(int a) __attribute__((const));
-/* empty args are allowed */
-int test3(int a) __attribute__((weak()));
-int test4(int a) __attribute__((unknown_error("bla", 3)));
-int test5(int a) __attribute__((alias("test2")));
-int test6(int a) __attribute__((section("extra")));
-int test7(int a, const char *fmt, ...) __attribute__((format(printf,2,3)));
-
-struct X {
- char y;
- int x __attribute__((aligned(4+4)));
-};
-
-int test2(int a) {
- return a;
-}
-
-int main(void) {
- return test5(0);
-}
+++ /dev/null
-__attribute__((noreturn)) void d0(void), __attribute__((format(printf,1,2))) d1(const char*, ...), d2(void);
-
-int main(void) {
- return 0;
-}
+++ /dev/null
-int test(int x) {
- static void *array[] = { &&foo, &&bar, &&hack };
-
- goto *array[x];
-foo: return 1;
-bar: return 2;
-hack: return 3;
-}
-
-int main(int argc, char *argv[]) {
- return test(1) == 2 ? 0 : 1;
-}
+++ /dev/null
-int puts(const char *str);
-
-void __attribute__((constructor)) construct(void)
-{
- puts("Hello");
-}
-
-void __attribute__((destructor)) destruct(void)
-{
- puts("Goobye");
-}
-
-int main(void)
-{
- puts("Main");
- return 0;
-}
+++ /dev/null
-// works with gcc 3.4.4 and icc 10.1
-typedef void(*__cdecl PIMAGE_TLS_CALLBACK)();
-typedef void(__cdecl* PIMAGE_TLS_CALLBACK2)();
-
-// works with gcc 3.4.4
-typedef void(__attribute__((__stdcall__)) *PIMAGE_TLS_CALLBACK3)();
-typedef void(*__attribute__((__stdcall__)) PIMAGE_TLS_CALLBACK4)();
-
-int main(void)
-{
- return 0;
-}
+++ /dev/null
-struct empty {};
-
-int main(int argc, char *argv[]) {
- return sizeof(struct empty);
-}
+++ /dev/null
-int main(int argc, char *argv[]) {
- return 27 == '\e' ? 0 : 1;
-}
+++ /dev/null
-enum e;
-
-int main(int argc, char *argv[]) {
- enum e { a, b };
-
- return 0;
-}
+++ /dev/null
-inline int puts(const char *str);
-
-int main(void)
-{
- puts("Hello");
- return 0;
-}
+++ /dev/null
-extern void puts(const char *str);
-
-int test(int a, int b) {
- puts("here");
- if (a) {
- __label__ label;
- puts("P1");
- if (b) {
- puts("before goto");
- goto label;
- }
- puts("behind if");
- b = 1;
-label:
-label2:
- puts("behind label (1)");
- ++b;
- }
-
- if (a) {
- __label__ label;
- puts("P2");
- goto label;
- if (a) {
- __label__ label;
-label3:
- puts("behind label3");
- goto label;
-label: ;
- puts("behind label (2)");
- }
- if (b) {
- puts("goto fininsh");
- goto finish;
- }
- b = 1;
-label:
- puts("behind label (3)");
- ++b;
- goto label3;
- }
-finish:
- puts("finished");
- return b;
-}
-
-int main(int argc, char *argv[]) {
- test(1, 42);
- return 0;
-}
+++ /dev/null
-typedef int i16 __attribute__ ((__mode__ (__HI__))), i32;
-/*typedef int i16;*/
-
-int size16 = sizeof(i16);
-/*int size32 = sizeof(i32); */
-
-i16 p16;
-short *ps16 = &p16;
-
-int main(void) {
- return size16 != 2;
-}
+++ /dev/null
-int test(void) {
- return 'abcd';
-}
-
-int main(int argc, char *argv[]) {
- printf("%X\n", test());
- return 0;
-}
+++ /dev/null
-int f(int a) {
- __label__ end;
-
- int g(int k) {
- if (k == 0)
- goto end;
- return k + a;
- }
-
- return g(1);
-end:
- return 23;
-}
-
-int main(int argc, char *argv[]) {
- return f(-1);
-}
+++ /dev/null
-int main(int argc, char *argv[]) {
- int res = argc ? : 8;
-
- return 0;
-}
+++ /dev/null
-typedef int (*func)(void);
-
-void *add(void *p) {
- return p + 1;
-}
-
-func next(func f) {
- return f + 1;
-}
-
-int main(void) {
- void *a = 0;
- a += 5;
- return 0;
-}
+++ /dev/null
-struct sockaddr {
- int bla;
-};
-
-struct sockaddr_at {
- int blo, blup;
-};
-
-typedef union bla {
- struct sockaddr *__restrict__ sockaddr_ptr;
- struct sockaddr_at *__restrict__ sockaddr_at_ptr;
-} sockaddr_arg __attribute__((__transparent_union__));
-
-void *t_recvfrom(sockaddr_arg arg) {
- return arg.sockaddr_at_ptr;
-}
-
-int main(void) {
- struct sockaddr_at at;
- int r = (t_recvfrom(&at) != &at);
- return r;
-}
+++ /dev/null
-struct sockaddr {
- int bla;
-};
-
-struct sockaddr_at {
- int blo, blup;
-};
-
-typedef union bla {
- struct sockaddr *__restrict__ sockaddr_ptr;
- struct sockaddr_at *__restrict__ sockaddr_at_ptr;
-} sockaddr_arg __attribute__((__transparent_union__));
-
-void *t_recvfrom(sockaddr_arg arg) {
- return arg.sockaddr_at_ptr;
-}
-
-int main(void) {
- struct sockaddr_at at;
- union bla bl;
- bl.sockaddr_at_ptr = &at;
- int r = (t_recvfrom(&at) != &at);
- r |= (bl.sockaddr_at_ptr != &at);
- return r;
-}
+++ /dev/null
-union foo { int i; double d; };
-int x;
-double y;
-
-union foo u;
-
-void hack (union foo p) {
- y = p.d;
-}
-
-int main(int argc, char *argv[]) {
- u = (union foo) x;
-
- hack ((union foo) x);
- return 0;
-}
+++ /dev/null
-#include <stdio.h>
-
-int main(int argc, char *argv[]) {
- printf("%f\n", 0x1.fp3);
- return 0;
-}
+++ /dev/null
-int printf(const char *str, ...);
-
-int main(void) {
- printf("%f\n", __builtin_huge_val());
- return 0;
-}
+++ /dev/null
-int test1(int a) {
- if (a);
- return a;
-}
-
-int main(void)
-{
- return 0;
-}
+++ /dev/null
-void test1() {
- puts("Hello");
-}
-
-void test2() {
- int i;
- for(i = rand(); i < 20; ++i)
- break;
-}
-
-int main(void) {
- test1();
- test2();
- return 0;
-}
+++ /dev/null
-struct X {
- int x;
-};
-
-struct X bla = { x: 23 };
-
-int main(void)
-{
- printf("%d\n", bla.x);
- return 0;
-}
+++ /dev/null
-struct { char str[10]; int y; } bla[] = { [13].str = { 1, 2,3 } };
-
-int main() {
- return bla[13].str[1] != 2;
-}
+++ /dev/null
-struct S {
- int a, b;
-} glob;
-
-struct S *globptr = &glob;
-struct S *globptr2 = &*&glob;
-int *intptr = &*&glob.b;
-int *intp2 = &(&glob + 3)->b;
-
-int arr[10];
-int *p = arr + 4;
-
-int main(void)
-{
- return 0;
-}
+++ /dev/null
-int bla = 1;
-int bla2 = 2;
-int bla3 = { 3 };
-int bla4 = { 4, };
-/* should fail:
-int bla5 = { { 2 } };
-int bla6 = { 1, 2 };
-int *bla7 = { 2, };
-int bla5 = 1, ;
-*/
-
-char str1[] = "Hello";
-char str2[5] = "Hello";
-char str3[10] = "Hello";
-signed char str4[] = "Hello";
-unsigned char str5[] = "Hello";
-/* char str4[4] = "Hello"; unclear wether this should be an error or warning
- * gcc produces a warning, icc an error */
-
-struct foo {
- int a, b;
-};
-
-struct foo f1 = { 1, 2 };
-struct foo f2 = { { 1,
- }
- , 2 }; /* produces a warning on icc and gcc... */
-struct foo f3 = { { { 1, } }, 2 }; /* produces a warning on icc and gcc... */
-
-struct foob {
- int a;
- struct foobb {
- float c, d;
- } f;
- int e;
-};
-
-struct foob ff2 = { 1, 2.5, 4.4, 2 };
-
-union foou {
- int a;
- float b;
-};
-
-union foou g1 = { 5 };
-
-int main() {
- return 0;
-}
+++ /dev/null
-int printf(const char *str, ...);
-
-int a(first, second, third)
- float second;
- const char *third;
- int first;
-{
- printf("Args: %d %f %s\n", first, second, third);
- return 0;
-}
-
-int main(void)
-{
- a(42, 42.42, "What is 6 times 9?\n");
- return 0;
-}
+++ /dev/null
-int printf(const char *str, ...);
-
-static int a(int first, float second, const char *third);
-
-int main(void)
-{
- a(42, 42.42, "What is 6 times 9?\n");
- return 0;
-}
-
-static int a(first, second, third)
- float second;
- const char *third;
- int first;
-{
- printf("Args: %d %f %s\n", first, second, third);
- return 0;
-}
+++ /dev/null
-foo(s)
-{
- return s;
-}
-
-int main(void)
-{
- return foo(0);
-}
+++ /dev/null
-int printf(const char *str, ...);
-
-struct x {};
-struct x a[] = { {}, {} };
-
-int size = sizeof(a);
-
-int main() {
- printf("%u\n", (unsigned) sizeof(a));
-}
+++ /dev/null
-int puts(const char *msg);
-
-int k(const char *msg) {
- puts(msg);
- double gl = 12;
- {
- extern int gl;
- return gl;
- }
-}
-
-int gl = 42;
-
-int main(void)
-{
- double k = 12;
-
- {
- int k(const char *msg);
- int res = k("Hallo");
- return res != 42;
- }
-}
+++ /dev/null
-int func(void) { return 0; }
-
-int (*ptr)(void) = func;
-int (*ptr2)(void) = *&*&func;
-
-int main(void) {
- return ptr2() + ptr();
-}
+++ /dev/null
-struct A {
- int k;
- struct B {
- int a, b[4];
- } blup[2];
- struct C {
- int a : 5;
- int b : 3;
- } c;
-};
-
-int k = __builtin_offsetof(struct A, blup[2].b[3]);
-
-int main(void)
-{
- return k == 0;
-}
+++ /dev/null
-int printf(const char *std, ...);
-
-int h(int a, int b) {
- return 1 << a % b;
-}
-
-int main(void) {
- printf("%d\n", h(5, 2));
- return 0;
-}
+++ /dev/null
-int f(void) {
- int i = 0;
- while(--i){
- i++;
- }
- return 0;
-}
-
-int main(void)
-{
- return 0;
-}
+++ /dev/null
-int f(void) {
- int a;
- if (a > 0)
- return 4;
- return 0;
-}
-
-int main(void)
-{
- return 0;
-}
+++ /dev/null
-int test(int *a) {
- return *a;
-}
-
-int main() {
- register int a = 3;
-
- printf("%d\n", test(&a));
-}
+++ /dev/null
-typedef struct {
- int a;
- union {
- struct {
- double a;
- };
- };
-
- float b;
-} blup;
-
-int main(void)
-{
- blup b;
- return 0;
-}
+++ /dev/null
-typedef void AVoid;
-
-int f(AVoid f);
-
-int main(void)
-{
- return 0;
-}
+++ /dev/null
-struct S {
- int :45;
- int x: -1;
- int y: 0;
- int z: 36364754;
-};
+++ /dev/null
-int main(int argc, char **argv)
-{
+++ /dev/null
-int test(int a) {
- return a;
-}
-
-int main(void) {
- return test(0, 2);
-}
+++ /dev/null
-int test(int a, int b) {
- return a + b;
-}
-
-int main(void) {
- return test(0);
-}
+++ /dev/null
-char *p1 = (char *)0.0;
-char *p2 = (char *)4.5;
-
-struct S { int a; } x;
-struct T { int b; } y = (struct T)x;
+++ /dev/null
-int main(int argc, char **argv)
-{
- char *res = argc > 2 ? argv[1] : 42;
- return (int) res;
-}
+++ /dev/null
-
-void t(void)
-{
- typedef int Int;
- typedef const Int CInt;
- typedef CInt MyCInt;
-
- MyCInt k;
-
- k = 5; /* should fail, assignment to const */
-}
+++ /dev/null
-void bi_windup(int k);
-
-void bi_windup();
-
-void bi_windup() {
-}
-
-int main(void)
-{
- return 0;
-}
+++ /dev/null
-typedef int (functype) (int a);
-
-functype blo
-{
- return a;
-}
+++ /dev/null
-int a;
-int b;
-
-int main(int argc, char **argv) {
- (void) argv;
- argc ? a = b : b = a;
- return 0;
-}
+++ /dev/null
-void foo(void)
-{
-lable:
- int jummy = 5;
-}
+++ /dev/null
-enum Bla;
-
-int test(enum Bla bla) {
- return bla;
-}
-
-enum Bla {
- Blo
-};
+++ /dev/null
-#error PRINT THIS
+++ /dev/null
-int k |= 4;
-
-int foo(void)
-{
- int l |= 2;
-}
+++ /dev/null
-int main(void) {
-
- for(int i = 0; i < ; ++i) {
- }
-
- for(int a = 0; a < 10; ++a) {
- }
-
- return 0;
-}
+++ /dev/null
-int func(void)
-{
- return 5;
-}
-
-int main(void)
-{
- func = 54;
- return 0;
-}
+++ /dev/null
-typedef int (function)(int);
-typedef void broken_array[8];
-typedef int int_array[8];
-
-broken_array x;
-
-typedef function func2(void);
-
-func2 test;
-
-broken_array test2(void);
-int_array test3(void);
+++ /dev/null
-int main(void)
-{
- struct S q, r;
- return 0;
-}
+++ /dev/null
-typedef struct {
- int a, b;
-} Stru1;
-
-typedef struct {
- double d;
- Stru1 stru;
- float c;
-} Stru2;
-
-static const Stru1 k = { 4, 2 };
-static const Stru2 a = { 2.4, k, 0.4f };
+++ /dev/null
-struct S {
- int a, b;
-};
-
-struct S arr[] = { { 1, 2, { 3, 4 } } };
-
-int main(void)
-{
- return 0;
-}
+++ /dev/null
-static const int l = 5;
-
-struct S {
- int a, b;
-};
-
-struct S arr[] = { 1, l };
-
-int main(void)
-{
- return 0;
-}
+++ /dev/null
-static const int l = 5;
-
-struct k {
- int c, d;
-};
-
-struct S {
- int a;
- struct k k;
-};
-
-struct S arr[] = { 1, (struct k) { 4, l } };
-
-int main(void)
-{
- return 0;
-}
+++ /dev/null
-struct S {
- int a, b;
-} glob;
-
-struct S *globptr = &glob;
-struct S *globptr2 = &*&glob;
-int *intptr = &*&glob.b;
-int *intp2 = ((int*) ((short) &intptr));
-
-int main(void)
-{
- return 0;
-}
+++ /dev/null
-
-int a(first, second, third)
- float second;
- float first;
- const char *third;
- int first;
-{
- printf("Args: %d %f %s\n", first, second, third);
- return 0;
-}
-
-int main(void)
-{
- a(42, 42.42, "What is 6 times 9?\n");
- return 0;
-}
+++ /dev/null
-
-int a(first, second, third)
- const char *third;
- float first;
-{
- printf("Args: %f %d %s\n", first, second, third);
- return 0;
-}
-
-int main(void)
-{
- a(42.32, 42, "What is 6 times 9?\n");
- return 0;
-}
+++ /dev/null
-extern int k;
-
-int a(first, second, third)
- const char *third;
- float first;
- int second;
- int k;
- float l;
-{
- printf("Args: %d %f %s\n", first, second, third);
- return 0;
-}
-
-int main(void)
-{
- a(42.32, 42, "What is 6 times 9?\n");
- return 0;
-}
+++ /dev/null
-int main() {
- goto missing;
- goto missing2;
-}
+++ /dev/null
-int a, b;
-
-int main(void) {
- a + b = 20;
- return 0;
-}
+++ /dev/null
-int test1(int a) {
- if (a > 3) {
- return 1;
- else {
- return 2;
- }
-}
-
-int test2(int a, int b) {
- return a ? 1 + : 2;
-}
-
-int test3(int b) {
- return (b + ;
-}
-
-int test4(int a) {
- return test2(a + , a);
-}
+++ /dev/null
-struct A {
- int a, b;
- int c, a;
-};
+++ /dev/null
-struct A {
- int k;
- struct B {
- int a, b[4];
- } blup[2];
- struct C {
- int a : 5;
- int b : 3;
- } c;
-};
-
-int k = __builtin_offsetof(struct A, blup[2].b[3]);
-int k2 = __builtin_offsetof(struct A, c.b);
-
-int main(void)
-{
- return k == 0;
-}
+++ /dev/null
-int func1(int)
-{
- return 0;
-}
-
-void func2(int x) {
- int x;
- {
- int x;
- }
-}
+++ /dev/null
-
-int func(int x) {
- int x;
-
- return x;
-}
+++ /dev/null
-int main(void) {
- void *a = 0;
- a += 5;
- return 0;
-}
+++ /dev/null
-int main(void) {
- int (*a)(void) = main;
- a += 2;
- return 0;
-}
+++ /dev/null
-int main(void) {
- void *a = 0;
- a = a + 5;
- return 0;
-}
+++ /dev/null
-int main(void) {
- void *a = 0;
- a = a - 5;
- return 0;
-}
+++ /dev/null
-int main(void) {
- void *a = 0;
- a++;
- return 0;
-}
+++ /dev/null
-int *test(void) {
- int x = 3;
-
- return &x;
-}
-
-int main() {
- return *test();
-}
+++ /dev/null
-#include <stdio.h>
-int main(int argc, char** argv) {
- printf("chk",%s);
- return 0;;}
+++ /dev/null
- double L ,o ,P
- ,_=dt,T,Z,D=1,d,
- s[999],E,h= 8,I,
- J,K,w[999],M,m,O
- ,n[999],j=33e-3,i=
- 1E3,r,t, u,v ,W,S=
- 74.5,l=221,X=7.26,
- a,B,A=32.2,c, F,H;
- int N,q, C, y,p,U;
- Window z; char f[52]
- ; GC k; main(){ Display*e=
- XOpenDisplay( 0); z=RootWindow(e,0); for (XSetForeground(e,k=XCreateGC (e,z,0,0),BlackPixel(e,0))
-; scanf("%lf%lf%lf",y +n,w+y, y+s)+1; y ++); XSelectInput(e,z= XCreateSimpleWindow(e,z,0,0,400,400,
-0,0,WhitePixel(e,0) ),KeyPressMask); for(XMapWindow(e,z); ; T=sin(O)){ struct timeval G={ 0,dt*1e6}
-; K= cos(j); N=1e4; M+= H*_; Z=D*K; F+=_*P; r=E*K; W=cos( O); m=K*W; H=K*T; O+=D*_*F/ K+d/K*E*_; B=
-sin(j); a=B*T*D-E*W; XClearWindow(e,z); t=T*E+ D*B*W; j+=d*_*D-_*F*E; P=W*E*B-T*D; for (o+=(I=D*W+E
-*T*B,E*d/K *B+v+B/K*F*D)*_; p<y; ){ T=p[s]+i; E=c-p[w]; D=n[p]-L; K=D*m-B*T-H*E; if(p [n]+w[ p]+p[s
-]== 0|K <fabs(W=T*r-I*E +D*P) |fabs(D=t *D+Z *T-a *E)> K)N=1e4; else{ q=W/K *4E2+2e2; C= 2E2+4e2/ K
- *D; N-1E4&& XDrawLine(e ,z,k,N ,U,q,C); N=q; U=C; } ++p; } L+=_* (X*t +P*M+m*l); T=X*X+ l*l+M *M;
- XDrawString(e,z,k ,20,380,f,17); D=v/l*15; i+=(B *l-M*r -X*Z)*_; for(; XPending(e); u *=CS!=N){
- XEvent z; XNextEvent(e ,&z);
- ++*((N=XLookupKeysym
- (&z.xkey,0))-IT?
- N-LT? UP-N?& E:&
- J:& u: &h); --*(
- DN -N? N-DT ?N==
- RT?&u: & W:&h:&J
- ); } m=15*F/l;
- c+=(I=M/ l,l*H
- +I*M+a*X)*_; H
- =A*r+v*X-F*l+(
- E=.1+X*4.9/l,t
- =T*m/32-I*T/24
- )/S; K=F*M+(
- h* 1e4/l-(T+
- E*5*T*E)/3e2
- )/S-X*d-B*A;
- a=2.63 /l*d;
- X+=( d*l-T/S
- *(.19*E +a
- *.64+J/1e3
- )-M* v +A*
- Z)*_; l +=
- K *_; W=d;
- sprintf(f,
- "%5d %3d"
- "%7d",p =l
- /1.7,(C=9E3+
- O*57.3)%0550,(int)i); d+=T*(.45-14/l*
- X-a*130-J* .14)*_/125e2+F*_*v; P=(T*(47
- *I-m* 52+E*94 *D-t*.38+u*.21*E) /1e2+W*
- 179*v)/2312; select(p=0,0,0,0,&G); v-=(
- W*F-T*(.63*m-I*.086+m*E*19-D*25-.11*u
- )/107e2)*_; D=cos(o); E=sin(o); } }
+++ /dev/null
-struct K { };
-
-struct K bla = { 1, 2 };
+++ /dev/null
-void f(void) {}
-int x = sizeof(f);
+++ /dev/null
-typedef struct {
- int a;
- char c;
- double d;
- double a;
-} t;
-
-int main(void)
-{
- return 0;
-}
+++ /dev/null
-struct L { int a; };
-
-int main(void)
-{
- struct L;
- struct L *k;
-
- return k->a;
-}
+++ /dev/null
-int test(int a) {
- switch (a);
-
- case 1:
- break;
-}
-
-int main(int argc) {
- switch(argc) {
- }
- case 1:
- break;
- default: continue;
-
-
- switch (argc) {
- case 1:
- break;
- case argc:
- default:
- default:
- break;
- }
- return 0;
-}
+++ /dev/null
-int k;
-
-void blup(void)
-{
- float k;
-
- {
- extern float k;
- k = 5.2;
- }
-}
+++ /dev/null
-struct sockaddr {
- int bla;
-};
-
-struct sockaddr_at {
- int blo, blup;
-};
-
-typedef union bla {
- struct sockaddr *__restrict__ sockaddr_ptr;
- struct sockaddr_at *__restrict__ sockaddr_at_ptr;
-} sockaddr_arg __attribute__((__transparent_union__));
-
-void *t_recvfrom(sockaddr_arg arg) {
- return arg.sockaddr_at_ptr;
-}
-
-int main(void) {
- struct sockaddr at;
- union bla bla = { &at };
- int r = (t_recvfrom(bla) != &at);
- return r;
-}
+++ /dev/null
-char s[] = "unclosed string
+++ /dev/null
-
-void f();
-
-void f() {
-}
-
-int main(void)
-{
- /* should at least give a warning */
- f(5);
- return 0;
-}
+++ /dev/null
-int y[4];
-void x[3];
-void z[3][5];
+++ /dev/null
-#include <stdio.h>
-
-int main(int argc, char *argv) {
- switch (argc) {
- ({ weird: printf("It's forbidden to jump here\n"); argc; });
- case -1:
- break;
- default:
- goto weird;
- }
- return 0;
-}
+++ /dev/null
-int test(int a, int b);
-
-int adr(int *x);
-
-int test1(itn a, int b) {
- return test(a,b);
-}
-
-int test2(int a, int b) {
- int arr[2];
-
- arr[0] = a;
- arr[1] = b;
-
- adr(arr);
- return arr[0] + arr[1];
-}
+++ /dev/null
-This directory contains testapps that exploit undefined behaviour, but should
-pass for practical reasons.
+++ /dev/null
-int printf(const char *fmt, ...);
-
-static void foo();
-
-static void kaputt(void) {
- foo(1);
-}
-
-static void foo(int a, int b) {
- (void) a;
- (void) b;
-}
-
-int main(void) {
- kaputt();
- return 0;
-}
+++ /dev/null
-int puts(const char *str);
-
-int test(s)
- char *s;
-{
- puts(s);
-}
-
-int main(void) {
- test("Hello World", 0);
- return 0;
-}
+++ /dev/null
-This directory contains testcases that should produces a certain warning
-(but no syntax errors)
+++ /dev/null
-/*$ -Wcast-qual $*/
-void test(const char *p) {
- char *q = (char *)p;
- volatile char *r = q;
- int *i = p;
-
- (void)p;
-
- *q = 1;
-}
-
-int main(int argc, char *argv[]) {
- return 0;
-}
+++ /dev/null
-struct s {
- char x[30];
-};
-
-struct s x[] = { "blup" };
-
-int main(void)
-{
- return x[0].x[0] != 'b';
-}
+++ /dev/null
-float NaN = 0.0/0.0;
-
-int main(int argc, char *argv[]) {
- return argc / 0;
-}
+++ /dev/null
-/*$ -Winit-self $*/
-
-int main(int argc, char *argv[]) {
- int i = i;
- return 0;
-}
+++ /dev/null
-int no_return_1(double *p) {
- double d = *p;
- ++d;
-}
-
-int no_return_2(int a) {
- if (a)
- ++a;
- else
- return 1;
-}
-
-int has_return_1(int a) {
- if (a)
- return a;
- else
- return 0;
-}
-
-int has_return_2(int a) {
- if (a)
- ++a;
- else
- --a;
- return a;
- ++a;
-}
-
-int has_return_3(int a) {
- do {
- return a;
- } while(a);
-}
-
-int no_return_3(int a) {
- switch (a) {
- case 1: return a;
- case 2: return a+1;
- }
-}
-
-int has_return_4(int a) {
- switch (a) {
- case 1: return a;
- case 2: return a+1;
- default: return 0;
- }
-}
-
-int no_return_4(int a) {
- goto end;
- return a;
-end:
- ++a;
-}
-
-int no_return_5(int a) {
- if (a)
- goto end;
- else {
- ++a;
- goto end;
- }
- return a;
-end:
- ++a;
-}
-
-int main() {
- return 0;
-}
+++ /dev/null
-/*$ -Wcomments $*/
-
-/* /* nested */
-
-// connected lines are NOT allowed \
-
-int main(int argc, char *argv[]) {
- return 0;
-}
+++ /dev/null
-/* -w -Wunused-variable */
-extern int rand(void);
-
-int main(void)
-{
- int x = 23;
- x = rand();
- return 0;
-}
+++ /dev/null
-/*$ -Wpadded $*/
-
-struct S {
- char c;
- int d;
-};
-
-struct T {
- int d;
- char c;
-};
-
-int main(int argc, char *argv[]) {
- return 0;
-}
+++ /dev/null
-int test(struct x *p) {
- return sizeof(p);
-}
-
-int main(int argc, char *argv[]) {
- return 0;
-}
+++ /dev/null
-int foo();
-
-int main(void) {
- return 0;
-}
+++ /dev/null
-int main(argc, argv)
- int argc;
- char **argv;
-{
- return 0;
-}
+++ /dev/null
-void test(unsigned a, unsigned b) {
- unsigned x = a - b;
- if (a >= b)
- return x;
- return 0;
-}
-
-int main(int argc, char *argv[]) {
- test(3,4);
- return 0;
-}
+++ /dev/null
-/*$ -Waggregate-return $*/
-
-struct S { int a, b; };
-union U { int a, b; };
-
-struct S testS(void) {
- struct S ret = { 1, 2 };
-
- return ret;
-}
-
-union U testU(void) {
- union U ret = { 2 };
-
- return ret;
-}
-
-int main(int argc, char *argv[]) {
- struct S x = testS();
- union U y = testU();
-
- return 0;
-}
+++ /dev/null
-enum e {
- a, b, c
-};
-
-enum e E;
-
-int main(int argc, char *argv[]) {
- switch (E) {
- case a: return 1;
- }
- return 0;
-}
+++ /dev/null
-/*$ -Wtraditional $*/
-
-int t1(int a) { return a; }
-int t2(double a) { return a; }
-int t3(char a) { return a; }
-
-int x() {
- int i = +3;
- return t1(0.0) + t2(0) + t3('a');
-}
-
-int sw1(long x) {
- switch(x) {
- default: return x;
- }
-}
-
-int sw2(unsigned x) {
- switch(x) {
- default: return x;
- }
-}
-
-char *str() {
- return "a" "b";
-}
-
-int suff(void);
-
-int suff() {
- unsigned a = 1U;
- float f = 1.0F;
- double d = 1.0L;
- unsigned long long bla = 1ULL;
- return (int) a;
-}
-
-int main(void)
-{
- return 0;
-}
+++ /dev/null
-int main(void)
-{
- int i[10];
- i[0] = 1;
- return 0;
-}
+++ /dev/null
-int main(void)
-{
- int j[10];
- j[j[j[0]]] = 23;
- return 0;
-}
+++ /dev/null
-struct X { int i[10]; int j; struct X* next; } gX;
-
-int main(void)
-{
- int x = 0;
- int y = 1;
- x = x + y;
- return 0;
-}
+++ /dev/null
-extern int rand(void);
-
-int main(void)
-{
- for(int z = 0; rand() % 2 != 0; ++z)
- z;
- return 0;
-}
+++ /dev/null
-int A;
-
-int main(void)
-{
- int *a = &A;
- a = &a[*a];
-
- return 0;
-}
+++ /dev/null
-struct X { int i[10]; int j; struct X* next; } gX;
-
-extern int rand(void);
-
-int main(void)
-{
- for (struct X* px = &gX; rand() % 2 == 0; px = px->next)
- {}
-
- return 0;
-}
+++ /dev/null
-int main(void)
-{
- int c;
- c = *&c = 0;
- return 0;
-}
+++ /dev/null
-#include <wchar.h>
-
-int main(int argc, char *argv[]) {
- char *p = "hallo";
- wchar_t *w = L"hallo";
-
- return 0;
-}
+++ /dev/null
-int puts(const char *str);
-
-int arr[100];
-
-int main(void) {
- arr[puts("hello1")] += 5;
- arr[puts("hello2")] -= 5;
- arr[puts("hello3")] *= 5;
- arr[puts("hello4")] /= 5;
- arr[puts("hello5")] %= 5;
- arr[puts("hello6")] &= 5;
- arr[puts("hello7")] |= 5;
- arr[puts("hello8")] ^= 5;
- arr[puts("hello9")]++;
- arr[puts("hello10")]--;
- ++arr[puts("hello11")];
- --arr[puts("hello12")];
- return 0;
-}
+++ /dev/null
-int printf(const char *str, ...);
-
-void f(void)
-{
- static int k = 42;
- {
- static int k = 13;
- ++k;
- printf("%d ", k);
- }
- --k;
- printf("%d\n", k);
-}
-
-int main(void)
-{
- f();
- f();
- f();
- f();
- return 0;
-}
+++ /dev/null
-struct L { int a; };
-
-int main(void)
-{
- struct L k = { 0 };
-
- return k.a;
-}
+++ /dev/null
-
-struct Bla {
- struct blup {
- int a, b;
- } d;
- int c;
-};
-
-struct blup f = { 1, 2 };
-
-int func(void)
-{
- struct blup {
- char str[20];
- };
- struct blup b = { "hullo" };
- return 0;
-}
-
-struct blup k = { 1, 2};
-
-int main() {
- return func();
-}
+++ /dev/null
-#include <assert.h>
-#include <limits.h>
-
-static int switch1(int k) {
- switch(k) {
- case 42:
- return 5;
- case 13:
- return 7;
- case INT_MAX:
- return 8;
- case -1:
- case INT_MIN:
- return 9;
- }
- return 3;
-}
-
-int main(void)
-{
- assert(switch1(42) == 5);
- assert(switch1(13) == 7);
- assert(switch1(-1) == 9);
- assert(switch1(700) == 3);
- assert(switch1(-32000) == 3);
- assert(switch1(INT_MAX) == 8);
- assert(switch1(INT_MIN) == 9);
- return 0;
-}
+++ /dev/null
-int printf(const char *fmt, ...);
-
-typedef union blub {
- int i;
- char a[4];
-} blub;
-
-blub a = {
- .i = 23,
- .a[2] = 23, 19
-};
-
-blub b = {
- .a[2] = 23, 19,
- .i = 23
-};
-
-#if 0
-blub c = {
- .a[2] = 23, 19, 17,
- .i = 23
-};
-#endif
-
-blub d = {
- .a[2] = 23,
- .i = 23,
- .a[3] = 19
-};
-
-blub e = {
- .a[2] = 23,
- .i = 23,
- .a[2] = 19, 23
-};
-
-blub f = {
- .i = 23,
- .a[2] = 23,
- .a[1] = 19
-};
-
-int main(void)
-{
- printf("%d %d %d %d\n", a.a[0], a.a[1], a.a[2], a.a[3]);
- printf("%d\n", b.i);
- printf("%d %d %d %d\n", d.a[0], d.a[1], d.a[2], d.a[3]);
- printf("%d %d %d %d\n", e.a[0], e.a[1], e.a[2], e.a[3]);
- printf("%d %d %d %d\n", f.a[0], f.a[1], f.a[2], f.a[3]);
- return 0;
-}
+++ /dev/null
-int puts(const char *str);
-void *memcpy(void *dest, const void *src, unsigned int n);
-
-int get_size(void)
-{
- puts("sideeffect");
- return 10;
-}
-
-int get_size2(void)
-{
- puts("sideeffect2");
- return 10;
-}
-
-int gk[10];
-
-int main(int argc, char **argv)
-{
- int k[get_size()];
- int c[argc][argc];
- int z[10];
-
- if(sizeof(k)/sizeof(int) != 10)
- return 1;
- if(sizeof(int[get_size2()])/sizeof(int) != 10)
- return 2;
- sizeof(c[puts("effect")]);
- sizeof(c[puts("effect2")][puts("but not this time")]);
- sizeof(z[puts("no effect")]);
-
- k[5] = 42;
- k[2] = 10;
- memcpy(gk, k, sizeof(gk));
-
- return 0;
-}
+++ /dev/null
-int a,b,c;
-
-int f1(void) {
- while(a < 10)
- return 0;
- return 42;
-}
-
-int f2(void) {
- while(0) {
- return 42;
- }
- return 0;
-}
-
-int f3(void) {
- while(f2());
- return 0;
-}
-
-int f5(void) {
- while(0);
- return 0;
-}
-
-int f4(void) {
- goto label;
-
- while(0) {
-label:
- return 0;
- }
- return 42;
-}
-
-int f6(void) {
- return 0;
-
- while(0);
-}
-
-int f7(void) {
- while(1) {
- return 0;
- }
-}
-
-int endless(void) {
- while(1);
-}
-
-int main(void) {
- return f1() + f2() + f3() + f4() + f5() * f6() + f7();
-}