Skip to content

Commit 11ddecc

Browse files
Add dump-parse-tree tests
1 parent 0dd8e14 commit 11ddecc

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

flang/include/flang/Parser/dump-parse-tree.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,8 +489,8 @@ class ParseTreeDumper {
489489
NODE(parser, OmpAlignedClause)
490490
NODE(OmpAlignedClause, Modifier)
491491
NODE(parser, OmpAtClause)
492-
NODE(OmpAtClause, ActionTime)
493-
NODE(OmpSeverityClause, Severity)
492+
NODE_ENUM(OmpAtClause, ActionTime)
493+
NODE_ENUM(OmpSeverityClause, Severity)
494494
NODE(parser, OmpAtomic)
495495
NODE(parser, OmpAtomicCapture)
496496
NODE(OmpAtomicCapture, Stmt1)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,23 @@
11
! RUN: %flang_fc1 -fopenmp-version=51 -fopenmp -fdebug-unparse-no-sema %s 2>&1 | FileCheck %s
2+
! RUN: %flang_fc1 -fopenmp-version=51 -fopenmp -fdebug-dump-parse-tree-no-sema %s 2>&1 | FileCheck %s --check-prefix="PARSE-TREE"
23
program main
34
character(*), parameter :: message = "This is an error"
45
!CHECK: !$OMP ERROR AT(COMPILATION) SEVERITY(WARNING) MESSAGE("some message here")
6+
!PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPErrorConstruct
7+
!PARSE-TREE: OmpClauseList -> OmpClause -> At -> OmpAtClause -> ActionTime = Compilation
8+
!PARSE-TREE: OmpClause -> Severity -> OmpSeverityClause -> Severity = Warning
9+
!PARSE-TREE: OmpClause -> Message -> OmpMessageClause -> Expr -> LiteralConstant -> CharLiteralConstant
510
!$omp error at(compilation) severity(warning) message("some message here")
611
!CHECK: !$OMP ERROR AT(COMPILATION) SEVERITY(FATAL) MESSAGE(message)
12+
!PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPErrorConstruct
13+
!PARSE-TREE: OmpClauseList -> OmpClause -> At -> OmpAtClause -> ActionTime = Compilation
14+
!PARSE-TREE: OmpClause -> Severity -> OmpSeverityClause -> Severity = Fatal
15+
!PARSE-TREE: OmpClause -> Message -> OmpMessageClause -> Expr -> Designator -> DataRef -> Name = 'message'
716
!$omp error at(compilation) severity(fatal) message(message)
817
!CHECK: !$OMP ERROR AT(EXECUTION) SEVERITY(FATAL) MESSAGE(message)
18+
!PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPErrorConstruct
19+
!PARSE-TREE: OmpClauseList -> OmpClause -> At -> OmpAtClause -> ActionTime = Execution
20+
!PARSE-TREE: OmpClause -> Severity -> OmpSeverityClause -> Severity = Fatal
21+
!PARSE-TREE: OmpClause -> Message -> OmpMessageClause -> Expr -> Designator -> DataRef -> Name = 'message'
922
!$omp error at(EXECUTION) severity(fatal) message(message)
1023
end program main

0 commit comments

Comments
 (0)