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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [torture/] [pr49079.c] - Blame information for rev 754

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

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-do run } */
2
 
3
extern void abort (void);
4
 
5
struct Ustr
6
{
7
  unsigned char data[1];
8
};
9
 
10
static unsigned int
11
ustr_xi__embed_val_get(const unsigned char *data)
12
{
13
  return (unsigned int)data[0];
14
}
15
 
16
int __attribute__((noinline)) zero(void) { return 0; }
17
 
18
static unsigned int
19
ustr_len(const struct Ustr *s1)
20
{
21
  return ustr_xi__embed_val_get(s1->data + 1 + zero());
22
}
23
 
24
int
25
main()
26
{
27
  if (ustr_len (((struct Ustr *) "\x01" "\x0002" "s2")) != 2)
28
    abort ();
29
 
30
  return 0;
31
}

powered by: WebSVN 2.1.0

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