[AArch64/arm] PR testsuite/85326 Avoid C++ tests when C++ compiler not present
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / pr39911.c
blob8a78c0a289f44ec8b2e1ae29f969515b0df77fb5
1 /* { dg-do assemble } */
2 /* { dg-options "-O2" } */
4 void
5 bar1 ()
7 char foo;
8 asm volatile ("mov%z0 %1, %0": "=m" (foo): "iq" (-23));
9 asm volatile ("add%z0 %1, %0": "+m" (foo): "iq" (23));
10 asm volatile ("mov%z0 %1, %0": "=q" (foo): "iq" (-23));
11 asm volatile ("add%z0 %1, %0": "+q" (foo): "iq" (23));
14 void
15 bar2 ()
17 short foo;
18 asm volatile ("mov%z0 %1, %0": "=m" (foo): "ir" (-23));
19 asm volatile ("add%z0 %1, %0": "+m" (foo): "ir" (23));
20 asm volatile ("mov%z0 %1, %0": "=r" (foo): "ir" (-23));
21 asm volatile ("add%z0 %1, %0": "+r" (foo): "ir" (23));
23 asm volatile ("pop%z0 %0": "=m" (foo));
24 asm volatile ("pop%z0 %0": "=r" (foo));
27 void
28 bar3 ()
30 int foo;
31 asm volatile ("mov%z0 %1, %0": "=m" (foo): "ir" (-23));
32 asm volatile ("add%z0 %1, %0": "+m" (foo): "ir" (23));
33 asm volatile ("mov%z0 %1, %0": "=r" (foo): "ir" (-23));
34 asm volatile ("add%z0 %1, %0": "+r" (foo): "ir" (23));
36 #ifndef __x86_64__
37 if (sizeof (void *) == sizeof (int))
39 asm volatile ("pop%z0 %0": "=m" (foo));
40 asm volatile ("pop%z0 %0": "=r" (foo));
42 #endif
45 void
46 bar4 ()
48 if (sizeof (void *) == sizeof (long long))
50 long long foo;
51 asm volatile ("mov%z0 %1, %0": "=m" (foo): "er" (-23));
52 asm volatile ("add%z0 %1, %0": "+m" (foo): "er" (23));
53 asm volatile ("mov%z0 %1, %0": "=r" (foo): "er" (-23));
54 asm volatile ("add%z0 %1, %0": "+r" (foo): "er" (23));
56 asm volatile ("pop%z0 %0": "=m" (foo));
57 asm volatile ("pop%z0 %0": "=r" (foo));