Debian Codegraph @

gcc/testsuite/gcc.target/s390/bswaphi-1.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O3 -march=z900 -mzarch" } */
3
4 #include <stdint.h>
5
6 uint16_t u16;
7
8 uint16_t
9 foo16a (uint16_t a)
10 {
11 return __builtin_bswap16 (a);
12 }
13 /* { dg-final { scan-assembler-times "lrvr\t%r2,%r\[0-9\]*" 1 } } */
14
15 uint16_t
16 foo16b ()
17 {
18 return __builtin_bswap16 (u16);
19 }
20 /* { dg-final { scan-assembler-times "lrvh\t%r2,0\\(%r\[0-9\]*\\)" 1 } } */
21
22 void
23 foo16c (uint16_t a)
24 {
25 u16 = __builtin_bswap16 (a);
26 }
27 /* { dg-final { scan-assembler-times "strvh\t%r2,0\\(%r\[0-9\]*\\)" 1 } } */