summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr20314-1.c
blob: 8a69c2dcaf54569a00e823d5ec94c2dd4787838c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/* PR inline-asm/20314 */
/* { dg-do compile { target i?86-*-* x86_64-*-* powerpc*-*-* ia64-*-* } } */

int
f1 (void)
{
  int x = 4, y;
  __asm__ volatile ("" : "+r,r" (x), "=r,r" (y)
		       : "%r,r" (x), "m,r" (8), "r,r" (2));
  return x;
}

int
f2 (void)
{
  int x = 4, y;
  __asm__ volatile ("" : "=r,r" (x), "=r,r" (y)
		       : "%0,0" (x), "m,r" (8), "r,r" (2));
  return x;
}

int
f3 (void)
{
  int x = 4, y;
  __asm__ volatile ("" : "+r,r" (x), "=r,r" (y)
		       : "%m,r" (8), "r,r" (2));
  return x;
}

int
f4 (void)
{
  int x = 4, y;
  __asm__ volatile ("" : "+r" (x), "=r" (y)
		       : "r" (x), "r" (8), "r" (2));
  return x;
}

int
f5 (void)
{
  int x = 4, y;
  __asm__ volatile ("" : "=r" (x), "=r" (y)
		       : "0" (x), "r" (8), "r" (2));
  return x;
}

int
f6 (void)
{
  int x = 4, y;
  __asm__ volatile ("" : "+r" (x), "=r" (y)
		       : "r" (8), "r" (2));
  return x;
}