[to-be-committed] [RISC-V] Improve (1 << N) | C for rv64
[official-gcc.git] / gcc / testsuite / gcc.target / s390 / bswaphi-1.c
blobf6be9b42d8cd4fd5adfa330ea47a82a8e0dfda7e
1 /* { dg-do compile } */
2 /* { dg-options "-O3 -march=z900 -mzarch" } */
4 #include <stdint.h>
6 uint16_t u16;
8 uint16_t
9 foo16a (uint16_t a)
11 return __builtin_bswap16 (a);
13 /* { dg-final { scan-assembler-times "lrvr\t%r2,%r\[0-9\]*" 1 } } */
15 uint16_t
16 foo16b ()
18 return __builtin_bswap16 (u16);
20 /* { dg-final { scan-assembler-times "lrvh\t%r2,0\\(%r\[0-9\]*\\)" 1 } } */
22 void
23 foo16c (uint16_t a)
25 u16 = __builtin_bswap16 (a);
27 /* { dg-final { scan-assembler-times "strvh\t%r2,0\\(%r\[0-9\]*\\)" 1 } } */