* gcc.dg/guality/asm-1.c: New test.
From-SVN: r162363
This commit is contained in:
parent
6b2b43d844
commit
a431e91330
@ -1,3 +1,7 @@
|
||||
2010-07-21 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* gcc.dg/guality/asm-1.c: New test.
|
||||
|
||||
2010-07-20 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||
|
||||
PR libfortran/44697
|
||||
|
25
gcc/testsuite/gcc.dg/guality/asm-1.c
Normal file
25
gcc/testsuite/gcc.dg/guality/asm-1.c
Normal file
@ -0,0 +1,25 @@
|
||||
/* { dg-do run } */
|
||||
/* { dg-options "-g" } */
|
||||
|
||||
struct A { int x; unsigned short y; char z[64]; };
|
||||
|
||||
void __attribute__((noinline))
|
||||
foo (struct A *p, char *q)
|
||||
{
|
||||
int f = &p->z[p->y] - q;
|
||||
asm volatile ("nop");
|
||||
asm volatile ("nop" : : "g" (f)); /* { dg-final { gdb-test 12 "f" "14" } } */
|
||||
asm volatile ("" : : "g" (p), "g" (q));
|
||||
}
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
struct A a;
|
||||
__builtin_memset (&a, 0, sizeof a);
|
||||
a.y = 26;
|
||||
a.x = 12;
|
||||
asm volatile ("" : : "r" (&a) : "memory");
|
||||
foo (&a, &a.z[a.x]);
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user