public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][ARM] New testcase to check parameter passing bug
@ 2015-03-13  2:08 Honggyu Kim
  2015-03-13 12:04 ` Kyrill Tkachov
  0 siblings, 1 reply; 11+ messages in thread
From: Honggyu Kim @ 2015-03-13  2:08 UTC (permalink / raw)
  To: gcc-patches; +Cc: Honggyu Kim

Hi,

I have wrote a testcase that reproduces argument overwriting bug during arm
code generation.

I wrote this testcase with the help of Mikael Pettersson.
If some format is not proper to run in gcc testsuite framework, please
correct me.

Please refer to the following bugzilla link for details:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65358

Honggyu
---
 gcc/testsuite/ChangeLog                |    5 +++++
 gcc/testsuite/gcc.target/arm/pr65358.c |   34 ++++++++++++++++++++++++++++++++
 2 files changed, 39 insertions(+)
 create mode 100644 gcc/testsuite/gcc.target/arm/pr65358.c

diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 5302dbd..9acd12a 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2015-03-13  Honggyu Kim  <hong.gyu.kim@lge.com>
+
+	PR target/65235
+	* gcc.target/arm/pr65358.c: New test for sibcall argument passing bug.
+
 2015-03-12  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
 
 	PR rtl-optimization/65235
diff --git a/gcc/testsuite/gcc.target/arm/pr65358.c b/gcc/testsuite/gcc.target/arm/pr65358.c
new file mode 100644
index 0000000..d663dcf
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/pr65358.c
@@ -0,0 +1,34 @@
+/* PR target/65358 */
+/* { dg-do compile { target arm*-*-* } } */
+/* { 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

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-03-29 11:36 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-13  2:08 [PATCH][ARM] New testcase to check parameter passing bug Honggyu Kim
2015-03-13 12:04 ` Kyrill Tkachov
2015-03-13 13:04   ` Christophe Lyon
2015-03-13 14:12   ` Segher Boessenkool
2015-03-16  0:54     ` Honggyu Kim
2015-03-18 11:53       ` Kyrill Tkachov
2015-03-19  1:40         ` [PATCH v2] " Honggyu Kim
2015-03-19  1:58           ` Honggyu Kim
2015-03-25 13:52           ` Jeff Law
2015-03-25 14:05             ` Kyrill Tkachov
2015-03-29 11:36               ` Honggyu Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).