diff options
author | Robert Dubner <rdubner@symas.com> | 2025-03-16 12:20:01 -0400 |
---|---|---|
committer | Robert Dubner <rdubner@symas.com> | 2025-03-16 15:45:38 -0400 |
commit | 427972b2f1335c7430785ad4afd15386a17156ec (patch) | |
tree | 2f429d43f61946596d34623a9c3afc7b2a8d1e1f /gcc | |
parent | c5ca45b8069229b6ad9bc845f03f46340f6316d7 (diff) | |
download | gcc-427972b2f1335c7430785ad4afd15386a17156ec.zip gcc-427972b2f1335c7430785ad4afd15386a17156ec.tar.gz gcc-427972b2f1335c7430785ad4afd15386a17156ec.tar.bz2 |
cobol: add cobol.dg/group1/escape.cob test; modify cobol.dg/gd.exp to handle it
gcc/testsuite
* cobol.dg/dg.exp: modified to recurse into directories without
.exp files and find *.cob files therein.
* cobol.dg/group1/escape.cob: New testcase.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/cobol.dg/dg.exp | 17 | ||||
-rw-r--r-- | gcc/testsuite/cobol.dg/group1/escape.cob | 11 |
2 files changed, 26 insertions, 2 deletions
diff --git a/gcc/testsuite/cobol.dg/dg.exp b/gcc/testsuite/cobol.dg/dg.exp index e75e3ab..d40cbd5 100644 --- a/gcc/testsuite/cobol.dg/dg.exp +++ b/gcc/testsuite/cobol.dg/dg.exp @@ -33,10 +33,23 @@ set cobol_test_path $srcdir/$subdir set all_flags $DEFAULT_COBFLAGS +# Recursively find files in $dir and subdirs, do not walk into subdirs +# that contain their own .exp file. +proc find-cob-tests { dir suffix } { + set tests [lsort [glob -nocomplain -directory $dir "*.$suffix" ]] + foreach subdir [lsort [glob -nocomplain -type d -directory $dir *]] { + if { [glob -nocomplain -directory $subdir *.exp] eq "" } { + eval lappend tests [find-cob-tests $subdir $suffix] + } + } + return $tests +} + +set tests [find-cob-tests $srcdir/$subdir {cob}] + # Main loop. if [check_effective_target_cobol] { - cobol-dg-runtest [lsort \ - [glob -nocomplain $srcdir/$subdir/*.cob ] ] "" $all_flags + cobol-dg-runtest $tests "" $all_flags } # All done. diff --git a/gcc/testsuite/cobol.dg/group1/escape.cob b/gcc/testsuite/cobol.dg/group1/escape.cob new file mode 100644 index 0000000..0ab5239 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group1/escape.cob @@ -0,0 +1,11 @@ +*> { dg-do run } +*> { dg-output {Testing the testing(\n|\r|\r\n)} } +*> { dg-output {\.\^\$\*\+\-\?\(\)\[\]\{\}\\\|(\n|\r|\r\n)} } +*> { dg-output {"\.\^\$\*\+\-\?\(\)\[\]\{\}\\\|"} } + identification division. + program-id. escape. + procedure division. + display "Testing the testing" + display ".^$*+-?()[]{}\|" + display '".^$*+-?()[]{}\|"' . + end program escape. |