xref: /llvm-project/flang/test/Parser/OpenMP/error-unparse.f90 (revision adeff9f63a24f60b0bf240bf13e40bbf7c1dd0e8)
1! RUN: %flang_fc1  -fopenmp-version=51 -fopenmp -fdebug-unparse %s 2>&1 | FileCheck %s
2! RUN: %flang_fc1  -fopenmp-version=51 -fopenmp -fdebug-dump-parse-tree %s 2>&1 | FileCheck %s --check-prefix="PARSE-TREE"
3program main
4  character(*), parameter :: message = "This is an error"
5  !CHECK: !$OMP ERROR AT(COMPILATION) SEVERITY(WARNING) MESSAGE("some message here")
6  !PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPUtilityConstruct -> OmpErrorDirective
7  !PARSE-TREE: OmpClauseList -> OmpClause -> At -> OmpAtClause -> ActionTime = Compilation
8  !PARSE-TREE: OmpClause -> Severity -> OmpSeverityClause -> Severity = Warning
9  !PARSE-TREE:  OmpClause -> Message -> OmpMessageClause -> Expr = '"some message here"'
10  !PARSE-TREE:  LiteralConstant -> CharLiteralConstant
11  !PARSE-TREE:  string = 'some message here'
12  !$omp error at(compilation) severity(warning) message("some message here")
13  !CHECK: !$OMP ERROR AT(COMPILATION) SEVERITY(FATAL) MESSAGE("This is an error")
14  !PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPUtilityConstruct -> OmpErrorDirective
15  !PARSE-TREE: OmpClauseList -> OmpClause -> At -> OmpAtClause -> ActionTime = Compilation
16  !PARSE-TREE: OmpClause -> Severity -> OmpSeverityClause -> Severity = Fatal
17  !PARSE-TREE:  OmpClause -> Message -> OmpMessageClause -> Expr = '"This is an error"'
18  !PARSE-TREE:  Designator -> DataRef -> Name = 'message'
19  !$omp error at(compilation) severity(fatal) message(message)
20  !CHECK: !$OMP ERROR AT(EXECUTION) SEVERITY(FATAL) MESSAGE("This is an error")
21  !PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPUtilityConstruct -> OmpErrorDirective
22  !PARSE-TREE: OmpClauseList -> OmpClause -> At -> OmpAtClause -> ActionTime = Execution
23  !PARSE-TREE: OmpClause -> Severity -> OmpSeverityClause -> Severity = Fatal
24  !PARSE-TREE:  OmpClause -> Message -> OmpMessageClause -> Expr = '"This is an error"'
25  !PARSE-TREE:  Designator ->  DataRef -> Name = 'message'
26  !$omp error at(EXECUTION) severity(fatal) message(message)
27end program main
28