[clang] [PowerPC] Align bcdsetsign Sema validation with other BCD builtins (PR #178121)

Tony Varghese via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 3 22:10:40 PST 2026


================
@@ -12,6 +12,14 @@
   int i = 1;                        \
   float f = 1.0f;
 
+vector unsigned char test_bcdsetsign(void) {
+  DECL_COMMON_VARS
+  vector unsigned char res_a = __builtin_ppc_bcdsetsign(scalar, '\1'); // expected-error {{argument 0 must be of type '__vector unsigned char' (vector of 16 'unsigned char' values}}
+  vector unsigned char res_b = __builtin_ppc_bcdsetsign(vec, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}
+  vector unsigned char res_c = __builtin_ppc_bcdsetsign(vec, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
----------------
tonykuttai wrote:

Please add a negative test for second argument with float input.

https://github.com/llvm/llvm-project/pull/178121


More information about the cfe-commits mailing list