The sourcerange was missing for a few directives when
they were the first directive to appear in a program
without a program statement.
Reviewed By: DavidTruby
Differential Revision: https://reviews.llvm.org/D153634
static bool NeedsScope(const parser::OpenMPBlockConstruct &);
+ bool Pre(const parser::OpenMPRequiresConstruct &x) {
+ AddOmpSourceRange(x.source);
+ return true;
+ }
+ bool Pre(const parser::OmpSimpleStandaloneDirective &x) {
+ AddOmpSourceRange(x.source);
+ return true;
+ }
bool Pre(const parser::OpenMPBlockConstruct &);
void Post(const parser::OpenMPBlockConstruct &);
bool Pre(const parser::OmpBeginBlockDirective &x) {
--- /dev/null
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
+
+!$omp barrier
+end
--- /dev/null
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
+
+!$omp requires reverse_offload
+end
--- /dev/null
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
+
+!$omp taskwait
+end