repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git]
/
old-autovect-branch
/
gcc
/
testsuite
/
g++.dg
/
opt
/
alias1.C
blob
4836c5be06ab565c7045e9c5b49dc93d9abf4561
1
// Test that type punning using an anonymous union works with strict aliasing.
2
// { dg-do run }
3
// { dg-options "-O2 -fstrict-aliasing" }
4
5
extern "C" void abort ();
6
7
void f (long i)
8
{
9
union
10
{
11
long ui;
12
float uf[20];
13
};
14
15
ui = i;
16
if (uf[0] != 42.0)
17
abort ();
18
}
19
20
int main ()
21
{
22
union U { long i; float f[20]; } u;
23
u.f[0] = 42.0;
24
f (u.i);
25
}