1 // RUN: %clang_cc1 -verify=expected,omp45 -fopenmp -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
2 // RUN: %clang_cc1 -verify=expected,omp51 -fopenmp -ferror-limit 100 %s -Wuninitialized
4 // RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
5 // RUN: %clang_cc1 -verify=expected,omp51 -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
7 struct S1
{ // expected-note 2 {{declared here}}
13 #pragma omp flush allocate(argc) // expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp flush'}}
15 #pragma omp flush untied // expected-error {{unexpected OpenMP clause 'untied' in directive '#pragma omp flush'}}
16 #pragma omp flush unknown // expected-warning {{extra tokens at the end of '#pragma omp flush' are ignored}}
18 #pragma omp flush // expected-error {{'#pragma omp flush' cannot be an immediate substatement}}
23 #pragma omp flush // expected-error {{'#pragma omp flush' cannot be an immediate substatement}}
28 #pragma omp flush // expected-error {{'#pragma omp flush' cannot be an immediate substatement}}
35 #pragma omp flush // expected-error {{'#pragma omp flush' cannot be an immediate substatement}}
38 #pragma omp flush // expected-error {{'#pragma omp flush' cannot be an immediate substatement}}
46 #pragma omp flush // expected-error {{'#pragma omp flush' cannot be an immediate substatement}}
53 #pragma omp flush // expected-error {{'#pragma omp flush' cannot be an immediate substatement}}
58 #pragma omp flush // expected-error {{'#pragma omp flush' cannot be an immediate substatement}}
64 #pragma omp flush( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
65 #pragma omp flush() // expected-error {{expected expression}}
66 #pragma omp flush(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
67 #pragma omp flush(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
68 #pragma omp flush(argc)
69 #pragma omp flush(S1) // expected-error {{'S1' does not refer to a value}}
70 #pragma omp flush(argc) flush(argc) // expected-warning {{extra tokens at the end of '#pragma omp flush' are ignored}}
71 #pragma omp parallel flush(argc) // expected-warning {{extra tokens at the end of '#pragma omp parallel' are ignored}}
76 int main(int argc
, char **argv
) {
79 #pragma omp flush untied // expected-error {{unexpected OpenMP clause 'untied' in directive '#pragma omp flush'}}
80 #pragma omp flush unknown // expected-warning {{extra tokens at the end of '#pragma omp flush' are ignored}}
82 #pragma omp flush // expected-error {{'#pragma omp flush' cannot be an immediate substatement}}
87 #pragma omp flush // expected-error {{'#pragma omp flush' cannot be an immediate substatement}}
92 #pragma omp flush // expected-error {{'#pragma omp flush' cannot be an immediate substatement}}
99 #pragma omp flush // expected-error {{'#pragma omp flush' cannot be an immediate substatement}}
102 #pragma omp flush // expected-error {{'#pragma omp flush' cannot be an immediate substatement}}
110 #pragma omp flush // expected-error {{'#pragma omp flush' cannot be an immediate substatement}}
117 #pragma omp flush // expected-error {{'#pragma omp flush' cannot be an immediate substatement}}
122 #pragma omp flush // expected-error {{'#pragma omp flush' cannot be an immediate substatement}}
128 #pragma omp flush( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
129 #pragma omp flush() // expected-error {{expected expression}}
130 #pragma omp flush(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
131 #pragma omp flush(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
132 #pragma omp flush(argc)
133 #pragma omp flush(S1) // expected-error {{'S1' does not refer to a value}}
134 #pragma omp flush(argc) flush(argc) // expected-warning {{extra tokens at the end of '#pragma omp flush' are ignored}}
135 #pragma omp parallel flush(argc) // expected-warning {{extra tokens at the end of '#pragma omp parallel' are ignored}}
137 #pragma omp flush seq_cst // expected-error {{unexpected OpenMP clause 'seq_cst' in directive '#pragma omp flush'}}
138 #pragma omp flush acq_rel // omp45-error {{unexpected OpenMP clause 'acq_rel' in directive '#pragma omp flush'}}
139 #pragma omp flush acquire // omp45-error {{unexpected OpenMP clause 'acquire' in directive '#pragma omp flush'}}
140 #pragma omp flush release // omp45-error {{unexpected OpenMP clause 'release' in directive '#pragma omp flush'}}
141 #pragma omp flush relaxed // expected-error {{unexpected OpenMP clause 'relaxed' in directive '#pragma omp flush'}}
142 #pragma omp flush seq_cst // expected-error {{unexpected OpenMP clause 'seq_cst' in directive '#pragma omp flush'}}
143 #pragma omp flush acq_rel acquire // omp45-error {{unexpected OpenMP clause 'acq_rel' in directive '#pragma omp flush'}} omp45-error {{unexpected OpenMP clause 'acquire' in directive '#pragma omp flush'}} omp51-error {{directive '#pragma omp flush' cannot contain more than one 'acq_rel', 'acquire' or 'release' clause}} omp51-note {{'acq_rel' clause used here}}
144 #pragma omp flush release acquire // omp45-error {{unexpected OpenMP clause 'release' in directive '#pragma omp flush'}} omp45-error {{unexpected OpenMP clause 'acquire' in directive '#pragma omp flush'}} omp51-error {{directive '#pragma omp flush' cannot contain more than one 'acq_rel', 'acquire' or 'release' clause}} omp51-note {{'release' clause used here}}
145 #pragma omp flush acq_rel (argc) // omp45-error {{unexpected OpenMP clause 'acq_rel' in directive '#pragma omp flush'}} expected-warning {{extra tokens at the end of '#pragma omp flush' are ignored}}
146 #pragma omp flush(argc) acq_rel // omp45-error {{unexpected OpenMP clause 'acq_rel' in directive '#pragma omp flush'}} omp51-error {{'flush' directive with memory order clause 'acq_rel' cannot have the list}} omp51-note {{memory order clause 'acq_rel' is specified here}}