Merge from mainline (165734:167278).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gcc.dg / guality / asm-1.c
blobe9cf4a167aab16e0552f76d4a16ae66e0f7b2933
1 /* { dg-do run } */
2 /* { dg-options "-g" } */
4 #include "../nop.h"
6 struct A { int x; unsigned short y; char z[64]; };
8 void __attribute__((noinline))
9 foo (struct A *p, char *q)
11 int f = &p->z[p->y] - q;
12 asm volatile (NOP);
13 asm volatile (NOP : : "g" (f)); /* { dg-final { gdb-test 14 "f" "14" } } */
14 asm volatile ("" : : "g" (p), "g" (q));
17 int
18 main ()
20 struct A a;
21 __builtin_memset (&a, 0, sizeof a);
22 a.y = 26;
23 a.x = 12;
24 asm volatile ("" : : "r" (&a) : "memory");
25 foo (&a, &a.z[a.x]);
26 return 0;