Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/gcc.c-torture/execute/mayalias-3.c @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
rev | line source |
---|---|
111 | 1 typedef struct __attribute__((__may_alias__)) { short x; } test; |
2 | |
3 test *p; | |
4 | |
5 int g(int *a) | |
6 { | |
7 p = (test*)a; | |
8 } | |
9 | |
10 int f() | |
11 { | |
12 int a; | |
13 g(&a); | |
14 a = 10; | |
15 test s={1}; | |
16 *p=s; | |
17 return a; | |
18 } | |
19 | |
20 int main() { | |
21 if (f() == 10) | |
22 __builtin_abort(); | |
23 return 0; | |
24 } | |
25 | |
26 |