================
@@ -0,0 +1,186 @@
+// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -std=c++20 -fopenmp 
-fopenmp-version=60 -fsyntax-only -Wuninitialized -verify %s
+
+void func() {
+
+    // expected-error@+2 {{statement after '#pragma omp fuse' must be a loop 
sequence containing canonical loops or loop-generating constructs}}
+    #pragma omp fuse 
+    ;
+
+    // expected-error@+2 {{statement after '#pragma omp fuse' must be a for 
loop}}
+    #pragma omp fuse 
+    {int bar = 0;}
+
+    // expected-error@+4 {{statement after '#pragma omp fuse' must be a for 
loop}}
+    #pragma omp fuse 
+    {
+        for(int i = 0; i < 10; ++i);
+        int x = 2;
+    }
+
+    // expected-error@+2 {{statement after '#pragma omp fuse' must be a loop 
sequence containing canonical loops or loop-generating constructs}}
+    #pragma omp fuse 
+    #pragma omp for 
+    for (int i = 0; i < 7; ++i)
+        ;
+
+    {
+        // expected-error@+2 {{expected statement}}
+        #pragma omp fuse
+    }
+
+    // expected-warning@+1 {{extra tokens at the end of '#pragma omp fuse' are 
ignored}}
+    #pragma omp fuse foo
+    {
+        for (int i = 0; i < 7; ++i)
+            ;
+        for(int j = 0; j < 100; ++j);
+
+    }
+
+
+    // expected-error@+1 {{unexpected OpenMP clause 'final' in directive 
'#pragma omp fuse'}}
+    #pragma omp fuse final(0) 
+    {
+        for (int i = 0; i < 7; ++i)
+            ;
+        for(int j = 0; j < 100; ++j);
+
+    }
+
+    //expected-error@+4 {{loop after '#pragma omp fuse' is not in canonical 
form}}
----------------
eZWALT wrote:

Is not that i need it, is that is emitted independently from the 1st one. I've 
simply added the first one, the 2nd is emitted probably from some 
CheckOpenMPLoop or other constraint checking function. Nevertheless, it is nice 
to have such detailed information althought i understand that in the tradeoff, 
it can result a bit verbose.

https://github.com/llvm/llvm-project/pull/139293
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to