20140828-1.c: New testcase.
authorAndrew Pinski <apinski@cavium.com>
Sat, 30 Aug 2014 22:35:43 +0000 (22:35 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Sat, 30 Aug 2014 22:35:43 +0000 (15:35 -0700)
2014-08-30  Andrew Pinski  <apinski@cavium.com>

        * gcc.c-torture/execute/20140828-1.c: New testcase.

From-SVN: r214760

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/20140828-1.c [new file with mode: 0644]

index b2f1bb2fcdd7086bf48d396724b10925599643a4..3ce39a550157b92fe9a56663d30e18e16821455e 100644 (file)
@@ -1,3 +1,7 @@
+2014-08-30  Andrew Pinski  <apinski@cavium.com>
+
+       * gcc.c-torture/execute/20140828-1.c: New testcase.
+
 2014-08-29  DJ Delorie  <dj@redhat.com>
 
        * lib/target-supports.exp (check_effective_target_size32plus):
diff --git a/gcc/testsuite/gcc.c-torture/execute/20140828-1.c b/gcc/testsuite/gcc.c-torture/execute/20140828-1.c
new file mode 100644 (file)
index 0000000..5eeb8e0
--- /dev/null
@@ -0,0 +1,22 @@
+short *f(short *a, int b, int *d) __attribute__((noinline,noclone));
+
+short *f(short *a, int b, int *d)
+{
+  short c = *a;
+  a++;
+  c = b << c;
+  *d = c;
+  return a;
+}
+
+int main(void)
+{
+  int d;
+  short a[2];
+  a[0] = 0;
+  if (f(a, 1, &d) != &a[1])
+    __builtin_abort ();
+  if (d != 1)
+    __builtin_abort ();
+  return 0;
+}