Debian Codegraph @

gcc/testsuite/gcc.c-torture/compile/r1.c

raw
1 /* { dg-additional-options "-std=gnu89" } */
2
3 void assert (a) {if (a != 1) abort ();}
4
5 int h1 (int *p) {return *p & 255;}
6
7 void p1 () {int a = 0x01020304; assert (h1 (&a) == 0x04);}
8
9
10 int h2 (a) {return a > 0;}
11
12 p2 () {assert (h2 (1));}
13
14 h3 (int *p)
15 {
16 *p |= 255;
17 }
18
19 p3 ()
20 {
21 int *p;
22 h3 (p);
23 }
24
25 main ()
26 {
27 p1 ();
28 p2 ();
29 p3 ();
30 puts ("Compiler test passed.");
31 }