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

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [mayalias-1.c] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 jlechner
/* Tests that the may_alias attribute works as expected.
2
   Author: Osku Salerma <osku@iki.fi> Apr 2002.  */
3
 
4
extern void abort(void);
5
extern void exit(int);
6
 
7
typedef short __attribute__((__may_alias__)) short_a;
8
 
9
int
10
main (void)
11
{
12
  int a = 0x12345678;
13
  short_a *b = (short_a*) &a;
14
 
15
  b[1] = 0;
16
 
17
  if (a == 0x12345678)
18
    abort();
19
 
20
  exit(0);
21
}

powered by: WebSVN 2.1.0

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