2016-12-21 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / pr35160.c
blob259c2a3eae3a7e195fbaaec6714b1cc138177a3b
1 /* PR inline-asm/35160 */
2 /* { dg-do run } */
3 /* { dg-skip-if "" { ia32 && { ! nonpic } } { "*" } { "" } } */
4 /* { dg-options "-O2" } */
6 extern void abort (void);
8 void
9 __attribute__((noinline))
10 foo (unsigned int *y)
12 unsigned int c0, c1, c2, d0, d1, d2;
13 d0 = 0; d1 = 0; d2 = 0; c0 = c1 = c2 = 0;
15 __asm__ ("movl $7, %k0; movl $8, %k1; movl $9, %k2"
16 : "+r" (d0), "+r" (d1), "+r" (d2));
17 __asm__ ("movl %3, %0; movl %4, %1; movl %5, %2"
18 : "+r" (c0), "+r" (c1), "+r" (c2), "+r" (d0), "+r" (d1), "+r" (d2));
19 y[0] = c0;
20 y[1] = c1;
21 y[2] = c2;
24 int
25 main (void)
27 unsigned int y[3];
28 foo (y);
29 if (y[0] != 7 || y[1] != 8 || y[2] != 9)
30 abort ();
31 return 0;