1 // RUN: %clang_cc1 -std=c23 -triple=x86_64-pc-linux-gnu -fsyntax-only -verify -Wpedantic %s
3 typedef int int2
__attribute__((ext_vector_type(2)));
5 void test_builtin_popcountg(short s
, int i
, __int128 i128
, _BitInt(128) bi128
,
8 // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
9 __builtin_popcountg(i
, i
);
10 // expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
11 __builtin_popcountg(s
);
12 // expected-error@-1 {{1st argument must be an unsigned integer (was 'short')}}
13 __builtin_popcountg(i
);
14 // expected-error@-1 {{1st argument must be an unsigned integer (was 'int')}}
15 __builtin_popcountg(i128
);
16 // expected-error@-1 {{1st argument must be an unsigned integer (was '__int128')}}
17 __builtin_popcountg(bi128
);
18 // expected-error@-1 {{1st argument must be an unsigned integer (was '_BitInt(128)')}}
19 __builtin_popcountg(d
);
20 // expected-error@-1 {{1st argument must be an unsigned integer (was 'double')}}
21 __builtin_popcountg(i2
);
22 // expected-error@-1 {{1st argument must be an unsigned integer (was 'int2' (vector of 2 'int' values))}}
25 void test_builtin_clzg(short s
, int i
, unsigned int ui
, __int128 i128
,
26 _BitInt(128) bi128
, double d
, int2 i2
) {
28 // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
29 __builtin_clzg(i
, i
, i
);
30 // expected-error@-1 {{too many arguments to function call, expected at most 2, have 3}}
32 // expected-error@-1 {{1st argument must be an unsigned integer (was 'short')}}
34 // expected-error@-1 {{1st argument must be an unsigned integer (was 'int')}}
36 // expected-error@-1 {{1st argument must be an unsigned integer (was '__int128')}}
37 __builtin_clzg(bi128
);
38 // expected-error@-1 {{1st argument must be an unsigned integer (was '_BitInt(128)')}}
40 // expected-error@-1 {{1st argument must be an unsigned integer (was 'double')}}
42 // expected-error@-1 {{1st argument must be an unsigned integer (was 'int2' (vector of 2 'int' values))}}
44 // expected-error@-1 {{1st argument must be an unsigned integer (was 'int2' (vector of 2 'int' values))}}
45 __builtin_clzg(ui
, ui
);
46 // expected-error@-1 {{2nd argument must be an 'int' (was 'unsigned int')}}
47 __builtin_clzg(ui
, i128
);
48 // expected-error@-1 {{2nd argument must be an 'int' (was '__int128')}}
49 __builtin_clzg(ui
, bi128
);
50 // expected-error@-1 {{2nd argument must be an 'int' (was '_BitInt(128)')}}
51 __builtin_clzg(ui
, d
);
52 // expected-error@-1 {{2nd argument must be an 'int' (was 'double')}}
53 __builtin_clzg(ui
, i2
);
54 // expected-error@-1 {{2nd argument must be an 'int' (was 'int2' (vector of 2 'int' values))}}
57 void test_builtin_ctzg(short s
, int i
, unsigned int ui
, __int128 i128
,
58 _BitInt(128) bi128
, double d
, int2 i2
) {
60 // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
61 __builtin_ctzg(i
, i
, i
);
62 // expected-error@-1 {{too many arguments to function call, expected at most 2, have 3}}
64 // expected-error@-1 {{1st argument must be an unsigned integer (was 'short')}}
66 // expected-error@-1 {{1st argument must be an unsigned integer (was 'int')}}
68 // expected-error@-1 {{1st argument must be an unsigned integer (was '__int128')}}
69 __builtin_ctzg(bi128
);
70 // expected-error@-1 {{1st argument must be an unsigned integer (was '_BitInt(128)')}}
72 // expected-error@-1 {{1st argument must be an unsigned integer (was 'double')}}
74 // expected-error@-1 {{1st argument must be an unsigned integer (was 'int2' (vector of 2 'int' values))}}
76 // expected-error@-1 {{1st argument must be an unsigned integer (was 'int2' (vector of 2 'int' values))}}
77 __builtin_ctzg(ui
, ui
);
78 // expected-error@-1 {{2nd argument must be an 'int' (was 'unsigned int')}}
79 __builtin_ctzg(ui
, i128
);
80 // expected-error@-1 {{2nd argument must be an 'int' (was '__int128')}}
81 __builtin_ctzg(ui
, bi128
);
82 // expected-error@-1 {{2nd argument must be an 'int' (was '_BitInt(128)')}}
83 __builtin_ctzg(ui
, d
);
84 // expected-error@-1 {{2nd argument must be an 'int' (was 'double')}}
85 __builtin_ctzg(ui
, i2
);
86 // expected-error@-1 {{2nd argument must be an 'int' (was 'int2' (vector of 2 'int' values))}}