annotate gcc/testsuite/gcc.dg/pr40501.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-do compile { target alpha*-*-* ia64*-*-* i?86-*-* x86_64-*-* s390x-*-* } } */
kono
parents:
diff changeset
2 /* { dg-options "-O2 -Wno-shift-overflow" } */
kono
parents:
diff changeset
3 /* { dg-require-effective-target lp64 } */
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 /* PR middle-end/40501 */
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 /* This once failed due to the bswap pass missing to add the type
kono
parents:
diff changeset
8 casts of the signed argument and result to the proper unsigned
kono
parents:
diff changeset
9 types. */
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 typedef long int int64_t;
kono
parents:
diff changeset
12
kono
parents:
diff changeset
13 int64_t
kono
parents:
diff changeset
14 swap64 (int64_t n)
kono
parents:
diff changeset
15 {
kono
parents:
diff changeset
16 return (((n & (((int64_t) 0xff) )) << 56) |
kono
parents:
diff changeset
17 ((n & (((int64_t) 0xff) << 8)) << 40) |
kono
parents:
diff changeset
18 ((n & (((int64_t) 0xff) << 16)) << 24) |
kono
parents:
diff changeset
19 ((n & (((int64_t) 0xff) << 24)) << 8) |
kono
parents:
diff changeset
20 ((n & (((int64_t) 0xff) << 32)) >> 8) |
kono
parents:
diff changeset
21 ((n & (((int64_t) 0xff) << 40)) >> 24) |
kono
parents:
diff changeset
22 ((n & (((int64_t) 0xff) << 48)) >> 40) |
kono
parents:
diff changeset
23 ((n & (((int64_t) 0xff) << 56)) >> 56));
kono
parents:
diff changeset
24 }