Debian Codegraph @

gcc/testsuite/gcc.dg/builtin-stdc-rotate-2.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "" } */
3
4 void
5 foo (void)
6 {
7 typedef int V __attribute__ ((vector_size (4 * sizeof (int))));
8 struct S { int s; };
9 enum E { E0, E1 };
10 __builtin_stdc_rotate_left (0.0f, 0); /* { dg-error "'__builtin_stdc_rotate_left' operand not an integral type" } */
11 __builtin_stdc_rotate_left (0.0, 0); /* { dg-error "'__builtin_stdc_rotate_left' operand not an integral type" } */
12 __builtin_stdc_rotate_left (0.0L, 0); /* { dg-error "'__builtin_stdc_rotate_left' operand not an integral type" } */
13 __builtin_stdc_rotate_left ((V) {}, 0); /* { dg-error "'__builtin_stdc_rotate_left' operand not an integral type" } */
14 __builtin_stdc_rotate_left ((struct S) { 0 }, 0); /* { dg-error "'__builtin_stdc_rotate_left' operand not an integral type" } */
15 __builtin_stdc_rotate_left (); /* { dg-error "wrong number of arguments to '__builtin_stdc_rotate_left'" } */
16 __builtin_stdc_rotate_left (0U); /* { dg-error "wrong number of arguments to '__builtin_stdc_rotate_left'" } */
17 __builtin_stdc_rotate_left (0U, 0U, 0U); /* { dg-error "wrong number of arguments to '__builtin_stdc_rotate_left'" } */
18 __builtin_stdc_rotate_left ((_Bool) 0, 0); /* { dg-error "argument 1 in call to function '__builtin_stdc_rotate_left' has boolean type" } */
19 __builtin_stdc_rotate_left ((enum E) E0, 0); /* { dg-error "argument 1 in call to function '__builtin_stdc_rotate_left' has enumerated type" } */
20 __builtin_stdc_rotate_left (0, 0); /* { dg-error "argument 1 in call to function '__builtin_stdc_rotate_left' has signed type" } */
21 __builtin_stdc_rotate_left (0U, 0.0f); /* { dg-error "'__builtin_stdc_rotate_left' operand not an integral type" } */
22 __builtin_stdc_rotate_left (0U, 0.0); /* { dg-error "'__builtin_stdc_rotate_left' operand not an integral type" } */
23 __builtin_stdc_rotate_left (0U, 0.0L); /* { dg-error "'__builtin_stdc_rotate_left' operand not an integral type" } */
24 __builtin_stdc_rotate_left (0U, (V) {}); /* { dg-error "'__builtin_stdc_rotate_left' operand not an integral type" } */
25 __builtin_stdc_rotate_left (0U, (struct S) { 0 }); /* { dg-error "'__builtin_stdc_rotate_left' operand not an integral type" } */
26 __builtin_stdc_rotate_left (0U, (enum E) E0); /* { dg-error "argument 2 in call to function '__builtin_stdc_rotate_left' has enumerated type" } */
27 __builtin_stdc_rotate_right (0.0f, 0); /* { dg-error "'__builtin_stdc_rotate_right' operand not an integral type" } */
28 __builtin_stdc_rotate_right (0.0, 0); /* { dg-error "'__builtin_stdc_rotate_right' operand not an integral type" } */
29 __builtin_stdc_rotate_right (0.0L, 0); /* { dg-error "'__builtin_stdc_rotate_right' operand not an integral type" } */
30 __builtin_stdc_rotate_right ((V) {}, 0); /* { dg-error "'__builtin_stdc_rotate_right' operand not an integral type" } */
31 __builtin_stdc_rotate_right ((struct S) { 0 }, 0); /* { dg-error "'__builtin_stdc_rotate_right' operand not an integral type" } */
32 __builtin_stdc_rotate_right (); /* { dg-error "wrong number of arguments to '__builtin_stdc_rotate_right'" } */
33 __builtin_stdc_rotate_right (0U); /* { dg-error "wrong number of arguments to '__builtin_stdc_rotate_right'" } */
34 __builtin_stdc_rotate_right (0U, 0U, 0U); /* { dg-error "wrong number of arguments to '__builtin_stdc_rotate_right'" } */
35 __builtin_stdc_rotate_right ((_Bool) 0, 0); /* { dg-error "argument 1 in call to function '__builtin_stdc_rotate_right' has boolean type" } */
36 __builtin_stdc_rotate_right ((enum E) E0, 0); /* { dg-error "argument 1 in call to function '__builtin_stdc_rotate_right' has enumerated type" } */
37 __builtin_stdc_rotate_right (0, 0); /* { dg-error "argument 1 in call to function '__builtin_stdc_rotate_right' has signed type" } */
38 __builtin_stdc_rotate_right (0U, 0.0f); /* { dg-error "'__builtin_stdc_rotate_right' operand not an integral type" } */
39 __builtin_stdc_rotate_right (0U, 0.0); /* { dg-error "'__builtin_stdc_rotate_right' operand not an integral type" } */
40 __builtin_stdc_rotate_right (0U, 0.0L); /* { dg-error "'__builtin_stdc_rotate_right' operand not an integral type" } */
41 __builtin_stdc_rotate_right (0U, (V) {}); /* { dg-error "'__builtin_stdc_rotate_right' operand not an integral type" } */
42 __builtin_stdc_rotate_right (0U, (struct S) { 0 }); /* { dg-error "'__builtin_stdc_rotate_right' operand not an integral type" } */
43 __builtin_stdc_rotate_right (0U, (enum E) E0); /* { dg-error "argument 2 in call to function '__builtin_stdc_rotate_right' has enumerated type" } */
44 __builtin_stdc_rotate_left ((unsigned char) 0, -1); /* { dg-warning "rotate count is negative" } */
45 __builtin_stdc_rotate_right ((unsigned char) 0, -1); /* { dg-warning "rotate count is negative" } */
46 __builtin_stdc_rotate_left ((unsigned short) 0, -1); /* { dg-warning "rotate count is negative" } */
47 __builtin_stdc_rotate_right ((unsigned short) 0, -1); /* { dg-warning "rotate count is negative" } */
48 __builtin_stdc_rotate_left (0U, -1); /* { dg-warning "rotate count is negative" } */
49 __builtin_stdc_rotate_right (0U, -1); /* { dg-warning "rotate count is negative" } */
50 __builtin_stdc_rotate_left (0UL, -1); /* { dg-warning "rotate count is negative" } */
51 __builtin_stdc_rotate_right (0UL, -1); /* { dg-warning "rotate count is negative" } */
52 __builtin_stdc_rotate_left (0ULL, -1); /* { dg-warning "rotate count is negative" } */
53 __builtin_stdc_rotate_right (0ULL, -1); /* { dg-warning "rotate count is negative" } */
54 #ifdef __SIZEOF_INT128__
55 __builtin_stdc_rotate_left ((unsigned __int128) 0, -1); /* { dg-warning "rotate count is negative" "" { target int128 } } */
56 __builtin_stdc_rotate_right ((unsigned __int128) 0, -1); /* { dg-warning "rotate count is negative" "" { target int128 } } */
57 #endif
58 #if __BITINT_MAXWIDTH__ >= 64
59 __builtin_stdc_rotate_left (0uwb, -1); /* { dg-warning "rotate count is negative" "" { target bitint } } */
60 __builtin_stdc_rotate_right (0uwb, -1); /* { dg-warning "rotate count is negative" "" { target bitint } } */
61 __builtin_stdc_rotate_left ((unsigned _BitInt(2)) 0, -1); /* { dg-warning "rotate count is negative" "" { target bitint } } */
62 __builtin_stdc_rotate_right ((unsigned _BitInt(2)) 0, -1); /* { dg-warning "rotate count is negative" "" { target bitint } } */
63 __builtin_stdc_rotate_left ((unsigned _BitInt(59)) 0, -1); /* { dg-warning "rotate count is negative" "" { target bitint } } */
64 __builtin_stdc_rotate_right ((unsigned _BitInt(59)) 0, -1); /* { dg-warning "rotate count is negative" "" { target bitint } } */
65 #endif
66 #if __BITINT_MAXWIDTH__ >= 575
67 __builtin_stdc_rotate_left ((unsigned _BitInt(525)) 0, -1); /* { dg-warning "rotate count is negative" "" { target bitint575 } } */
68 __builtin_stdc_rotate_right ((unsigned _BitInt(525)) 0, -1); /* { dg-warning "rotate count is negative" "" { target bitint575 } } */
69 #endif
70 }