Debian Codegraph @

clang/test/OpenMP/target_update_strided_struct_multiple_messages_from.c

raw
1 // RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
2 // RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
3
4 #define N 12
5 typedef struct {
6 double data[N];
7 int len;
8 } T;
9
10 int main(int argc, char **argv) {
11 T s1, s2;
12 s1.len = N;
13 s2.len = N;
14
15 // Valid multiple strided array sections
16 #pragma omp target update from(s1.data[0:4:2], s2.data[0:2:5]) // OK
17 {}
18
19 // Mixed strided and regular array sections
20 #pragma omp target update from(s1.data[0:s1.len], s2.data[0:4:2]) // OK
21 {}
22
23 // Invalid stride in one of multiple sections
24 #pragma omp target update from(s1.data[0:3:4], s2.data[0:2:0]) // expected-error {{section stride is evaluated to a non-positive value 0}}
25
26 // Missing colon
27 #pragma omp target update from(s1.data[0:4:2], s2.data[0:3 4]) // expected-error {{expected ']'}} expected-note {{to match this '['}}
28
29 return 0;
30 }