aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/torture/pr44492.C
blob: 41669241e7e6edb898eb8e6d370b8cf7aba939d1 (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
// PR middle-end/44492
// { dg-do run }

struct T { unsigned long p; };
struct S { T a, b, c; unsigned d; };

__attribute__((noinline))
void
bar (const T &x, const T &y)
{
  if (x.p != 0x2348 || y.p != 0x2346)
    __builtin_abort ();
}

__attribute__((noinline))
void
foo (S &s, T e)
{
  unsigned long a = e.p;
  unsigned long b = s.b.p;
  __asm__ volatile ("" : : "rm" (a), "rm" (b));
  bar (e, s.b);
}

int
main ()
{
  S s = { { 0x2345 }, { 0x2346 }, { 0x2347 }, 6 };
  T t = { 0x2348 };
  foo (s, t);
}