--- /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
-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;
-}