gdb/fortran: test case modified to suit the clang behavior.
authorBhuvanendra Kumar N <Bhuvanendra.KumarN@amd.com>
Mon, 17 May 2021 06:52:19 +0000 (12:22 +0530)
committerAlok Kumar Sharma <AlokKumar.Sharma@amd.com>
Mon, 17 May 2021 06:52:19 +0000 (12:22 +0530)
As mentioned in the test case itself, depending on the fortran compiler
used, class member names used in the print commands and also output of
these print commands varies. Existing print commands and its output are
suited for gfortran, hence they were failing with clang compiler and test
case was modified accordingly for clang compiler.

gdb/testsuite/ChangeLog:
        * gdb.base/class-allocatable-array.exp: Modified test for clang.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.fortran/class-allocatable-array.exp

index 0a8e5b202b0237bc2c9dbf91ecd1b0a0aa827d10..5a0159ffe6e7750f855858e3b1b41d3d14c0ed2d 100644 (file)
@@ -1,3 +1,7 @@
+2021-05-17  Bhuvanendra Kumar N  <Bhuvanendra.KumarN@amd.com>
+
+       * gdb.base/class-allocatable-array.exp: Modified test for clang.
+
 2021-05-16  Weimin Pan  <weimin.pan@oracle.com>
 
        * gdb.ctf/funcreturn.exp: New file.
index d2e30649422343a71b341e428897c150e98cb613..b98cd4fa13028c2814cd90a727ba39f6fbe4de5c 100644 (file)
@@ -38,6 +38,13 @@ gdb_continue_to_breakpoint "Break Here"
 # different names, or maybe a completely different approach, for
 # representing class like structures.  The following tests are
 # cetainly going to fail.
-gdb_test "print this" " = \\( _data = \[^\r\n\]+, _vptr = \[^\r\n\]+\\)"
-gdb_test "print this%_data" " = \\(PTR TO -> \\( Type test_type \\)\\) \[^\r\n\]+"
-gdb_test "print this%_data%b" " = \\(\\(1, 2, 3\\) \\(4, 5, 6\\)\\)"
+# Hence the test case is modified for clang.
+if {[test_compiler_info {clang-*}]} {
+    gdb_test "print this" " = \\( a = 0, b = \\(\\(1, 2, 3\\) \\(4, 5, 6\\)\\) \\)"
+    gdb_test "print this%a" " = 0"
+    gdb_test "print this%b" " = \\(\\(1, 2, 3\\) \\(4, 5, 6\\)\\)"
+} else {
+    gdb_test "print this" " = \\( _data = \[^\r\n\]+, _vptr = \[^\r\n\]+\\)"
+    gdb_test "print this%_data" " = \\(PTR TO -> \\( Type test_type \\)\\) \[^\r\n\]+"
+    gdb_test "print this%_data%b" " = \\(\\(1, 2, 3\\) \\(4, 5, 6\\)\\)"
+}
This page took 0.034685 seconds and 4 git commands to generate.