[clang] [OpenMP] Add assertion for 'factor' width mismatch in 'unroll partial' (PR #139986)

ALBIN BABU VARGHESE via cfe-commits cfe-commits at lists.llvm.org
Thu May 15 01:46:27 PDT 2025


================
@@ -58,8 +58,17 @@ void func(int n) {
   // expected-error at +1 {{argument to 'partial' clause must be a strictly positive integer value}} 
   #pragma omp unroll partial(0)
   for (int i = 0; i < n; ++i) {}
-    
-  // expected-error at +1 {{directive '#pragma omp unroll' cannot contain more than one 'partial' clause}} 
+
+  // expected-error at +1 {{unroll factor has width 64 but the iteration variable 'int' is only 32 bits wide}}
+  #pragma omp unroll partial(0xFFFFFFFFF)
+  for (int i = 0; i < 10; i++)
----------------
albus-droid wrote:

Also I have added new test to cover cases with short and char and revised the existing ones.

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


More information about the cfe-commits mailing list