summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/pr35160.c
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/gcc.target/i386/pr35160.c
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/gcc.target/i386/pr35160.c')
-rw-r--r--gcc/testsuite/gcc.target/i386/pr35160.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/i386/pr35160.c b/gcc/testsuite/gcc.target/i386/pr35160.c
new file mode 100644
index 000000000..12394ec6d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr35160.c
@@ -0,0 +1,32 @@
+/* PR inline-asm/35160 */
+/* { dg-do run } */
+/* { dg-skip-if "" { ilp32 && { ! nonpic } } { "*" } { "" } } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+
+void
+__attribute__((noinline))
+foo (unsigned int *y)
+{
+ unsigned int c0, c1, c2, d0, d1, d2;
+ d0 = 0; d1 = 0; d2 = 0; c0 = c1 = c2 = 0;
+
+ __asm__ ("movl $7, %k0; movl $8, %k1; movl $9, %k2"
+ : "+r" (d0), "+r" (d1), "+r" (d2));
+ __asm__ ("movl %3, %0; movl %4, %1; movl %5, %2"
+ : "+r" (c0), "+r" (c1), "+r" (c2), "+r" (d0), "+r" (d1), "+r" (d2));
+ y[0] = c0;
+ y[1] = c1;
+ y[2] = c2;
+}
+
+int
+main (void)
+{
+ unsigned int y[3];
+ foo (y);
+ if (y[0] != 7 || y[1] != 8 || y[2] != 9)
+ abort ();
+ return 0;
+}