Mercurial > hg > CbC > CbC_gcc
view libmudflap/testsuite/libmudflap.c/pass64-frag.c @ 61:60c1b2f8487a
remove expand_cbc_goto, and added warnig process.
author | ryoma <e075725@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 25 Apr 2010 17:03:45 +0900 (2010-04-25) |
parents | a06113de4d67 |
children |
line wrap: on
line source
/* PR libmudflap/36397 */ /* { dg-do run } */ /* { dg-options "-O -fmudflap -fno-strict-aliasing -lmudflap" } */ struct A { int a[2]; }; long long int x; int __attribute__ ((noinline)) baz (long long int *x) { return *x; } int __attribute__ ((noinline)) foo (int i) { if (i > 10) return baz (&x); return ((struct A *) &x)->a[i]; } int main (void) { if (sizeof (long long) == 2 * sizeof (int) && sizeof (long long) == sizeof (struct A)) { struct A a = { .a[0] = 10, .a[1] = 20 }; __builtin_memcpy (&x, &a, sizeof (x)); if (foo (0) != 10 || foo (1) != 20) __builtin_abort (); } return 0; }