Hi, I have modified the test-case to check parameter passing bug based on the comments from Kyrill Tkachov, Christophe Lyon, and Segher Boessenkool as follows: 1. move from "gcc.target/arm" to "gcc.dg" 2. change "dg-do compile" to "dg-do run"
Please let me know if there's still something to fix more. Thanks for your comment. Honggyu --- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.dg/pr65358.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/pr65358.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 77d24a1..218f908 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2015-03-19 Honggyu Kim <hong.gyu....@lge.com> + + * gcc.dg/pr65358.c: New test. + 2015-03-18 Paolo Carlini <paolo.carl...@oracle.com> PR c++/59816 diff --git a/gcc/testsuite/gcc.dg/pr65358.c b/gcc/testsuite/gcc.dg/pr65358.c new file mode 100644 index 0000000..ba89fd4 --- /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; +} -- 1.7.9.5