================
@@ -0,0 +1,33 @@
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
+
+int main(int argc, char **argv) {
+  int len = 8;
+  double data[len];
+
+  // Valid strided array sections
+  #pragma omp target update to(data[0:4:2]) // OK
+  {}
+
+  #pragma omp target update to(data[1:3:2]) // OK
+  {}
+
+  // Missing stride (default = 1)
+  #pragma omp target update to(data[0:4]) // OK
+  {}
+
+  // Invalid stride expressions
+  #pragma omp target update to(data[0:4:0]) // expected-error {{section stride 
is evaluated to a non-positive value 0}} expected-error {{expected at least one 
'to' clause or 'from' clause specified to '#pragma omp target update'}}
+
+  #pragma omp target update to(data[0:4:-1]) // expected-error {{section 
stride is evaluated to a non-positive value -1}} expected-error {{expected at 
least one 'to' clause or 'from' clause specified to '#pragma omp target 
update'}}
+
+  // Missing colon 
+  #pragma omp target update to(data[0:4 2]) // expected-error {{expected ']'}} 
expected-note {{to match this '['}} expected-error {{expected at least one 'to' 
clause or 'from' clause specified to '#pragma omp target update'}}
+  {}
+
+  // Too many colons
+  #pragma omp target update to(data[0:4:2:1]) // expected-error {{expected 
']'}} expected-note {{to match this '['}} expected-error {{expected at least 
one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
+  {}
+
+  return 0;
+}
----------------
shiltian wrote:

missing an empty file at EoF

https://github.com/llvm/llvm-project/pull/169623
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to