OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [guality/] [asm-1.c] - Blame information for rev 801

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-g" } */
3
 
4
#include "../nop.h"
5
 
6
struct A { int x; unsigned short y; char z[64]; };
7
 
8
void __attribute__((noinline))
9
foo (struct A *p, char *q)
10
{
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));
15
}
16
 
17
int
18
main ()
19
{
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;
27
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.