This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RE: [PATCH][ARM] New testcase to check parameter passing bug
- From: "Honggyu Kim" <hong dot gyu dot kim at lge dot com>
- To: "'Segher Boessenkool'" <segher at kernel dot crashing dot org>, "'Kyrill Tkachov'" <kyrylo dot tkachov at arm dot com>, <christophe dot lyon at st dot com>
- Cc: <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 16 Mar 2015 09:53:53 +0900
- Subject: RE: [PATCH][ARM] New testcase to check parameter passing bug
- Authentication-results: sourceware.org; auth=none
- References: <1426212518-14867-1-git-send-email-hong dot gyu dot kim at lge dot com> <000801d05d85$dbcb9450$9362bcf0$ at arm dot com> <20150313141229 dot GC7174 at gate dot crashing dot org>
Hi,
I have modified and moved the testcase following your comments.
(from gcc.target/arm to gcc.dg)
Please let me know if there's still something to fix more.
I appreciate all your comments.
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 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;
+}
--
1.7.9.5