repo.or.cz
/
sdcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
struct / union in initializer, RFE #901.
[sdcc.git]
/
sdcc
/
support
/
regression
/
tests
/
gcc-torture-execute-lto-tbaa-1.c
blob
88fa07f95bcbd99eca3df3f60daa3e5c821acee2
1
/*
2
lto-tbaa-1.c from the execute part of the gcc torture tests.
3
*/
4
5
#include <testfwk.h>
6
7
/* { dg-additional-options "-fno-early-inlining -fno-ipa-cp" } */
8
struct
a
{
9
float
*
b
;
10
} *
a
;
11
struct
b
{
12
int
*
b
;
13
}
b
;
14
struct
c
{
15
float
*
b
;
16
} *
c
;
17
int
d
;
18
void
use_a
(
struct
a
*
a
)
19
{
20
(
void
)
a
;
21
}
22
void
set_b
(
int
**
a
)
23
{
24
*
a
=&
d
;
25
}
26
void
use_c
(
struct
c
*
a
)
27
{
28
(
void
)
a
;
29
}
30
int
**
retme
(
int
**
val
)
31
{
32
return
val
;
33
}
34
int
e
;
35
struct
b b
= {&
e
};
36
struct
b b2
;
37
struct
b b3
;
38
int
**
ptr
= &
b2
.
b
;
39
void
40
testTortureExecute
(
void
)
41
{
42
a
= (
void
*)
0
;
43
b
.
b
=&
e
;
44
ptr
=
retme
( &
b
.
b
);
45
set_b
(
ptr
);
46
b3
=
b
;
47
ASSERT
(
b3
.
b
== &
d
);
48
c
= (
void
*)
0
;
49
return
;
50
}