================
@@ -54,3 +54,19 @@ int main(int argc, char **argv) {
   {}
   return 0;
 }
+
+extern int omp_is_initial_device(void);
+
+void gh140257(void) {
+  int i = 0, a[2];
+  #pragma omp target device(omp_is_initial_device) // expected-error 
{{expression must have integral or unscoped enumeration type, not 'int (void)'}}
+  i++;
+  #pragma omp target data map(i) device(omp_is_initial_device) // 
expected-error {{expression must have integral or unscoped enumeration type, 
not 'int (void)'}}
+  i++;
+  #pragma omp target map(a[omp_is_initial_device:1]) // expected-error 
{{expression must have integral or unscoped enumeration type, not 'int 
(void)'}} expected-error {{array section lower bound is not an integer}}
----------------
akash-manna-sky wrote:

Note: a non-integer array section bound like `map(a[1.5:2])` now gets two 
errors, because the existing `array section lower bound is not an integer` 
check finally fires. 

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

Reply via email to