summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/bswap16.c
blob: 5eea4f77491b976ceb95dbf48a74b182e2b3cf46 (plain)
1
2
3
4
5
6
7
8
/* { dg-do compile { target { powerpc*-*-* } } } */
/* { dg-options "-O2" } */
/* { dg-final { scan-assembler "lhbrx" } } */
/* { dg-final { scan-assembler "sthbrx" } } */

unsigned short us;
unsigned int load_bswap16 (unsigned short *p) { return __builtin_bswap16 (*p); }
void store_bswap16 (unsigned int a) { us = __builtin_bswap16 (a); }