Debian Codegraph @

clang/test/Sema/aarch64-sme-attrs-openmp-captured-region.c

raw
1 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme -target-feature +sme2 -fopenmp -fsyntax-only -verify %s
2 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme -target-feature +sme2 -fopenmp -fsyntax-only -verify=expected-cpp -x c++ %s
3
4 int compute(int);
5
6 void streaming_openmp_captured_region(int * out) __arm_streaming {
7 // expected-error@+2 {{OpenMP captured regions are not yet supported in streaming functions}}
8 // expected-cpp-error@+1 {{OpenMP captured regions are not yet supported in streaming functions}}
9 #pragma omp parallel for num_threads(32)
10 for (int ci = 0; ci < 8; ci++) {
11 out[ci] = compute(ci);
12 }
13 }
14
15 __arm_locally_streaming void locally_streaming_openmp_captured_region(int * out) {
16 // expected-error@+2 {{OpenMP captured regions are not yet supported in streaming functions}}
17 // expected-cpp-error@+1 {{OpenMP captured regions are not yet supported in streaming functions}}
18 #pragma omp parallel for num_threads(32)
19 for (int ci = 0; ci < 8; ci++) {
20 out[ci] = compute(ci);
21 }
22 }
23
24 void za_state_captured_region(int * out) __arm_inout("za") {
25 // expected-error@+2 {{OpenMP captured regions are not yet supported in functions with ZA state}}
26 // expected-cpp-error@+1 {{OpenMP captured regions are not yet supported in functions with ZA state}}
27 #pragma omp parallel for num_threads(32)
28 for (int ci = 0; ci < 8; ci++) {
29 out[ci] = compute(ci);
30 }
31 }
32
33 __arm_new("za") void new_za_state_captured_region(int * out) {
34 // expected-error@+2 {{OpenMP captured regions are not yet supported in functions with ZA state}}
35 // expected-cpp-error@+1 {{OpenMP captured regions are not yet supported in functions with ZA state}}
36 #pragma omp parallel for num_threads(32)
37 for (int ci = 0; ci < 8; ci++) {
38 out[ci] = compute(ci);
39 }
40 }
41
42 void zt0_state_openmp_captured_region(int * out) __arm_inout("zt0") {
43 // expected-error@+2 {{OpenMP captured regions are not yet supported in functions with ZT0 state}}
44 // expected-cpp-error@+1 {{OpenMP captured regions are not yet supported in functions with ZT0 state}}
45 #pragma omp parallel for num_threads(32)
46 for (int ci = 0; ci < 8; ci++) {
47 out[ci] = compute(ci);
48 }
49 }
50
51 __arm_new("zt0") void new_zt0_state_openmp_captured_region(int * out) {
52 // expected-error@+2 {{OpenMP captured regions are not yet supported in functions with ZT0 state}}
53 // expected-cpp-error@+1 {{OpenMP captured regions are not yet supported in functions with ZT0 state}}
54 #pragma omp parallel for num_threads(32)
55 for (int ci = 0; ci < 8; ci++) {
56 out[ci] = compute(ci);
57 }
58 }
59
60 /// OpenMP directives that don't create a captured region are okay:
61
62 void streaming_function_openmp(int * out) __arm_streaming __arm_inout("za", "zt0") {
63 #pragma omp unroll full
64 for (int ci = 0; ci < 8; ci++) {
65 out[ci] = compute(ci);
66 }
67 }
68
69 __arm_locally_streaming void locally_streaming_openmp(int * out) __arm_inout("za", "zt0") {
70 #pragma omp unroll full
71 for (int ci = 0; ci < 8; ci++) {
72 out[ci] = compute(ci);
73 }
74 }
75
76 __arm_new("za", "zt0") void arm_new_openmp(int * out) {
77 #pragma omp unroll full
78 for (int ci = 0; ci < 8; ci++) {
79 out[ci] = compute(ci);
80 }
81 }