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
PR inline-asm/84742
[official-gcc.git]
/
gcc
/
testsuite
/
gcc.c-torture
/
execute
/
bitfld-6.c
blob
b8c5cbd285859cd1bf556b79b31009c00fbe6ca0
1
/* { dg-require-effective-target int32plus } */
2
union
U
3
{
4
const int
a
;
5
unsigned
b
:
20
;
6
};
7
8
static union
U u
= {
0x12345678
};
9
10
/* Constant folding used to fail to account for endianness when folding a
11
union. */
12
13
int
14
main
(
void
)
15
{
16
#ifdef __BYTE_ORDER__
17
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
18
return
u
.
b
-
0x45678
;
19
#else
20
return
u
.
b
-
0x12345
;
21
#endif
22
#endif
23
return
0
;
24
}