================
@@ -505,6 +505,27 @@ void test_builtin_elementwise_log2(int i, float f, double
d, float4 v, int3 iv,
// expected-error@-1 {{1st argument must be a floating point type (was
'unsigned4' (vector of 4 'unsigned int' values))}}
}
+void test_builtin_elementwise_popcount(int i, float f, double d, float4 v,
int3 iv, unsigned u, unsigned4 uv) {
+
+ struct Foo s = __builtin_elementwise_popcount(i);
+ // expected-error@-1 {{initializing 'struct Foo' with an expression of
incompatible type 'int'}}
+
+ i = __builtin_elementwise_popcount();
+ // expected-error@-1 {{too few arguments to function call, expected 1, have
0}}
+
+ i = __builtin_elementwise_popcount(f);
+ // expected-error@-1 {{1st argument must be a vector of integers (was
'float')}}
+
+ i = __builtin_elementwise_popcount(f, f);
+ // expected-error@-1 {{too many arguments to function call, expected 1, have
2}}
+
+ u = __builtin_elementwise_popcount(d);
+ // expected-error@-1 {{1st argument must be a vector of integers (was
'double')}}
+
+ v = __builtin_elementwise_popcount(v);
+ // expected-error@-1 {{1st argument must be a vector of integers (was
'float4' (vector of 4 'float' values))}}
----------------
RKSimon wrote:
please can you add tests for vector element count mismatches and implicit arg
vs result vector extension/truncation/sign changes
https://github.com/llvm/llvm-project/pull/108121
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits