Message ID | 051201d05f83$ae23a330$0a6ae990$@lge.com |
---|---|
State | New |
Headers | show |
Hi Honggyu, On 16/03/15 00:53, Honggyu Kim wrote: > new file mode 100644 > index 0000000..3790764 > --- /dev/null > +++ b/gcc/testsuite/gcc.dg/pr65358.c > @@ -0,0 +1,33 @@ > +/* { dg-do run */ Forgot to close the brace here after 'run' Dejagnu happily ignores that and transforms this into a compile-only testcase without that. Otherwise looks good to me. Kyrill > +/* { dg-options "-O2" } */ > + > +struct pack > +{ > + int fine; > + int victim; > + int killer; > +}; > +
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5302dbd..5dcf2cf 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2015-03-16 Honggyu Kim <hong.gyu.kim@lge.com> + + * gcc.dg/pr65358.c: New test. + 2015-03-15 John David Anglin <danglin@gcc.gnu.org> * gcc.dg/torture/pr65270-1.c: Add -fno-common to dg-options on diff --git a/gcc/testsuite/gcc.dg/pr65358.c b/gcc/testsuite/gcc.dg/pr65358.c new file mode 100644 index 0000000..3790764 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr65358.c @@ -0,0 +1,33 @@ +/* { dg-do run */ +/* { dg-options "-O2" } */ + +struct pack +{ + int fine; + int victim; + int killer; +}; + +int __attribute__ ((__noinline__, __noclone__)) +bar (int a, int b, struct pack p) +{ + if (a != 20 || b != 30) + __builtin_abort (); + if (p.fine != 40 || p.victim != 50 || p.killer != 60) + __builtin_abort (); + return 0; +} + +int __attribute__ ((__noinline__, __noclone__)) +foo (int arg1, int arg2, int arg3, struct pack p) +{ + return bar (arg2, arg3, p); +} + +int main (void) +{ + struct pack p = { 40, 50, 60 }; + + (void) foo (10, 20, 30, p); + return 0; +}