URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [tree-ssa/] [20040121-1.c] - Rev 816
Compare with Previous | Blame | View Log
/* Test that (p!=0) + (q!=0) is computed as int, not boolean */ /* { dg-options "-O3" } */ /* { dg-do run } */ extern void abort (void); char *foo(char *p, char *q) { int x = (p !=0) + (q != 0); if (x==2) return "a"; else return 0; } extern char *bar(char*, char*) __attribute__((noinline)); char *bar(char *first, char *last) { int y; if (!first) return last; if (!last) return first; if (*first == 'a') return foo(first, last); return 0; } main() { char *p = "a", *q = "b"; if (p) if (bar(p,q)) return 0; abort(); }