repo.or.cz
/
llvm-project.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git]
/
clang
/
test
/
CodeGenCXX
/
2005-02-11-AnonymousUnion.cpp
blob
dee5817360500614e7b5489ba3c51cc272c54fe6
1
// RUN: %clang_cc1 %s -emit-llvm -o -
2
3
// Test anonymous union with members of the same size.
4
int
test1
(
float
F
) {
5
union
{
6
float
G
;
7
int
i
;
8
};
9
G
=
F
;
10
return
i
;
11
}
12
13
// test anonymous union with members of differing size.
14
int
test2
(
short
F
) {
15
volatile
union
{
16
short
G
;
17
int
i
;
18
};
19
G
=
F
;
20
return
i
;
21
}
22
23
// Make sure that normal unions work. duh :)
24
volatile
union
U_t
{
25
short
S
;
26
int
i
;
27
}
U
;
28
29
int
test3
(
short
s
) {
30
U
.
S
=
s
;
31
return
U
.
i
;
32
}