]>
Commit | Line | Data |
---|---|---|
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 | ||
7 | typedef unsigned char u8; | |
8 | typedef unsigned int u32; | |
9 | union __anonunion_out_195 | |
10 | { | |
11 | u32 value; | |
12 | u8 bytes[4]; | |
13 | }; | |
14 | union __anonunion_in_196 | |
15 | { | |
16 | u32 value; | |
17 | u8 bytes[4]; | |
18 | }; | |
19 | extern void acpi_ut_track_stack_ptr (void); | |
20 | u32 acpi_ut_dword_byte_swap (u32 value); | |
21 | u32 | |
22 | acpi_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" } } */ |