aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/nvptx/rotate-run.c
blob: 14cb6f8b0b3fe4a8d9997eec1015b66062c6ae14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* { dg-do run } */
/* { dg-options "-O2" } */

#include "rotate.c"

#define ASSERT(EXPR)				\
  do						\
    {						\
      if (!(EXPR))				\
	__builtin_abort ();			\
    } while (0)

int
main (void)
{
  ASSERT (rotl (0x12345678, 8) == 0x34567812);
  ASSERT (rotl (0x12345678, 8 + 32) == 0x34567812);

  ASSERT (rotr (0x12345678, 8) == 0x78123456);
  ASSERT (rotr (0x12345678, 8 + 32) == 0x78123456);

  return 0;
}