aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/builtin-stdc-rotate-2.c
blob: d87419698d2203b7422099eb836960c4be7433e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/* { dg-do compile } */
/* { dg-options "" } */

void
foo (void)
{
  typedef int V __attribute__ ((vector_size (4 * sizeof (int))));
  struct S { int s; };
  enum E { E0, E1 };
  __builtin_stdc_rotate_left (0.0f, 0);			/* { dg-error "'__builtin_stdc_rotate_left' operand not an integral type" } */
  __builtin_stdc_rotate_left (0.0, 0);			/* { dg-error "'__builtin_stdc_rotate_left' operand not an integral type" } */
  __builtin_stdc_rotate_left (0.0L, 0);			/* { dg-error "'__builtin_stdc_rotate_left' operand not an integral type" } */
  __builtin_stdc_rotate_left ((V) {}, 0);		/* { dg-error "'__builtin_stdc_rotate_left' operand not an integral type" } */
  __builtin_stdc_rotate_left ((struct S) { 0 }, 0);	/* { dg-error "'__builtin_stdc_rotate_left' operand not an integral type" } */
  __builtin_stdc_rotate_left ();			/* { dg-error "wrong number of arguments to '__builtin_stdc_rotate_left'" } */
  __builtin_stdc_rotate_left (0U);			/* { dg-error "wrong number of arguments to '__builtin_stdc_rotate_left'" } */
  __builtin_stdc_rotate_left (0U, 0U, 0U);		/* { dg-error "wrong number of arguments to '__builtin_stdc_rotate_left'" } */
  __builtin_stdc_rotate_left ((_Bool) 0, 0);		/* { dg-error "argument 1 in call to function '__builtin_stdc_rotate_left' has boolean type" } */
  __builtin_stdc_rotate_left ((enum E) E0, 0);		/* { dg-error "argument 1 in call to function '__builtin_stdc_rotate_left' has enumerated type" } */
  __builtin_stdc_rotate_left (0, 0);			/* { dg-error "argument 1 in call to function '__builtin_stdc_rotate_left' has signed type" } */
  __builtin_stdc_rotate_left (0U, 0.0f);		/* { dg-error "'__builtin_stdc_rotate_left' operand not an integral type" } */
  __builtin_stdc_rotate_left (0U, 0.0);			/* { dg-error "'__builtin_stdc_rotate_left' operand not an integral type" } */
  __builtin_stdc_rotate_left (0U, 0.0L);		/* { dg-error "'__builtin_stdc_rotate_left' operand not an integral type" } */
  __builtin_stdc_rotate_left (0U, (V) {});		/* { dg-error "'__builtin_stdc_rotate_left' operand not an integral type" } */
  __builtin_stdc_rotate_left (0U, (struct S) { 0 });	/* { dg-error "'__builtin_stdc_rotate_left' operand not an integral type" } */
  __builtin_stdc_rotate_left (0U, (enum E) E0);		/* { dg-error "argument 2 in call to function '__builtin_stdc_rotate_left' has enumerated type" } */
  __builtin_stdc_rotate_right (0.0f, 0);		/* { dg-error "'__builtin_stdc_rotate_right' operand not an integral type" } */
  __builtin_stdc_rotate_right (0.0, 0);			/* { dg-error "'__builtin_stdc_rotate_right' operand not an integral type" } */
  __builtin_stdc_rotate_right (0.0L, 0);		/* { dg-error "'__builtin_stdc_rotate_right' operand not an integral type" } */
  __builtin_stdc_rotate_right ((V) {}, 0);		/* { dg-error "'__builtin_stdc_rotate_right' operand not an integral type" } */
  __builtin_stdc_rotate_right ((struct S) { 0 }, 0);	/* { dg-error "'__builtin_stdc_rotate_right' operand not an integral type" } */
  __builtin_stdc_rotate_right ();			/* { dg-error "wrong number of arguments to '__builtin_stdc_rotate_right'" } */
  __builtin_stdc_rotate_right (0U);			/* { dg-error "wrong number of arguments to '__builtin_stdc_rotate_right'" } */
  __builtin_stdc_rotate_right (0U, 0U, 0U);		/* { dg-error "wrong number of arguments to '__builtin_stdc_rotate_right'" } */
  __builtin_stdc_rotate_right ((_Bool) 0, 0);		/* { dg-error "argument 1 in call to function '__builtin_stdc_rotate_right' has boolean type" } */
  __builtin_stdc_rotate_right ((enum E) E0, 0);		/* { dg-error "argument 1 in call to function '__builtin_stdc_rotate_right' has enumerated type" } */
  __builtin_stdc_rotate_right (0, 0);			/* { dg-error "argument 1 in call to function '__builtin_stdc_rotate_right' has signed type" } */
  __builtin_stdc_rotate_right (0U, 0.0f);		/* { dg-error "'__builtin_stdc_rotate_right' operand not an integral type" } */
  __builtin_stdc_rotate_right (0U, 0.0);		/* { dg-error "'__builtin_stdc_rotate_right' operand not an integral type" } */
  __builtin_stdc_rotate_right (0U, 0.0L);		/* { dg-error "'__builtin_stdc_rotate_right' operand not an integral type" } */
  __builtin_stdc_rotate_right (0U, (V) {});		/* { dg-error "'__builtin_stdc_rotate_right' operand not an integral type" } */
  __builtin_stdc_rotate_right (0U, (struct S) { 0 });	/* { dg-error "'__builtin_stdc_rotate_right' operand not an integral type" } */
  __builtin_stdc_rotate_right (0U, (enum E) E0);	/* { dg-error "argument 2 in call to function '__builtin_stdc_rotate_right' has enumerated type" } */
  __builtin_stdc_rotate_left ((unsigned char) 0, -1);	/* { dg-warning "rotate count is negative" } */
  __builtin_stdc_rotate_right ((unsigned char) 0, -1);	/* { dg-warning "rotate count is negative" } */
  __builtin_stdc_rotate_left ((unsigned short) 0, -1);	/* { dg-warning "rotate count is negative" } */
  __builtin_stdc_rotate_right ((unsigned short) 0, -1);	/* { dg-warning "rotate count is negative" } */
  __builtin_stdc_rotate_left (0U, -1);			/* { dg-warning "rotate count is negative" } */
  __builtin_stdc_rotate_right (0U, -1);			/* { dg-warning "rotate count is negative" } */
  __builtin_stdc_rotate_left (0UL, -1);			/* { dg-warning "rotate count is negative" } */
  __builtin_stdc_rotate_right (0UL, -1);		/* { dg-warning "rotate count is negative" } */
  __builtin_stdc_rotate_left (0ULL, -1);		/* { dg-warning "rotate count is negative" } */
  __builtin_stdc_rotate_right (0ULL, -1);		/* { dg-warning "rotate count is negative" } */
#ifdef __SIZEOF_INT128__
  __builtin_stdc_rotate_left ((unsigned __int128) 0, -1); /* { dg-warning "rotate count is negative" "" { target int128 } } */
  __builtin_stdc_rotate_right ((unsigned __int128) 0, -1); /* { dg-warning "rotate count is negative" "" { target int128 } } */
#endif
#if __BITINT_MAXWIDTH__ >= 64
  __builtin_stdc_rotate_left (0uwb, -1);		/* { dg-warning "rotate count is negative" "" { target bitint } } */
  __builtin_stdc_rotate_right (0uwb, -1);		/* { dg-warning "rotate count is negative" "" { target bitint } } */
  __builtin_stdc_rotate_left ((unsigned _BitInt(2)) 0, -1); /* { dg-warning "rotate count is negative" "" { target bitint } } */
  __builtin_stdc_rotate_right ((unsigned _BitInt(2)) 0, -1); /* { dg-warning "rotate count is negative" "" { target bitint } } */
  __builtin_stdc_rotate_left ((unsigned _BitInt(59)) 0, -1); /* { dg-warning "rotate count is negative" "" { target bitint } } */
  __builtin_stdc_rotate_right ((unsigned _BitInt(59)) 0, -1); /* { dg-warning "rotate count is negative" "" { target bitint } } */
#endif
#if __BITINT_MAXWIDTH__ >= 575
  __builtin_stdc_rotate_left ((unsigned _BitInt(525)) 0, -1); /* { dg-warning "rotate count is negative" "" { target bitint575 } } */
  __builtin_stdc_rotate_right ((unsigned _BitInt(525)) 0, -1); /* { dg-warning "rotate count is negative" "" { target bitint575 } } */
#endif
}