]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.dg/optimize-bswapsi-6.c
Update copyright years.
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / optimize-bswapsi-6.c
CommitLineData
1f94ed3b
L
1/* PR tree-optimization/42587 */
2/* { dg-do compile } */
3/* { dg-require-effective-target bswap } */
b4e81f6d 4/* { dg-options "-O2 -fno-tree-vectorize -fdump-tree-store-merging" } */
1f94ed3b
L
5/* { dg-additional-options "-march=z900" { target s390-*-* } } */
6
7typedef unsigned char u8;
8typedef unsigned int u32;
9union __anonunion_out_195
10{
11 u32 value;
12 u8 bytes[4];
13};
14union __anonunion_in_196
15{
16 u32 value;
17 u8 bytes[4];
18};
19extern void acpi_ut_track_stack_ptr (void);
20u32 acpi_ut_dword_byte_swap (u32 value);
21u32
22acpi_ut_dword_byte_swap (u32 value)
23{
24 union __anonunion_out_195 out;
25 union __anonunion_in_196 in;
26
27 {
28 acpi_ut_track_stack_ptr ();
29 in.value = value;
30 out.bytes[0] = in.bytes[3];
31 out.bytes[1] = in.bytes[2];
32 out.bytes[2] = in.bytes[1];
33 out.bytes[3] = in.bytes[0];
34 return (out.value);
35 }
36}
37
38/* { dg-final { scan-tree-dump "32 bit bswap implementation found at" "store-merging" } } */