• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Revision4c60f96807d8559a56412d846b96b9cccedfa8e7 (tree)
Zeit2016-09-07 19:19:36
AutorBernhard Heckel <bernhard.heckel@inte...>
CommiterBernhard Heckel

Log Message

Fortran: Testsuite, add cyclic pointers.

2016-05-25 Bernhard Heckel <bernhard.heckel@intel.com>

gdb/testsuite/Changelog:
* pointers.f90: Add cylic pointers.
* pointers.exp: Add print of cyclic pointers.

Change-Id: Ic3b6187c5980fd6c37e2e94787f8321e5b7f2d75

Ändern Zusammenfassung

Diff

--- a/gdb/testsuite/gdb.fortran/pointers.exp
+++ b/gdb/testsuite/gdb.fortran/pointers.exp
@@ -57,6 +57,24 @@ gdb_test_multiple "print intap" $test {
5757 gdb_test "print realp" "= \\(PTR TO -> \\( $real \\)\\) 0x0" "print realp, not associated"
5858 gdb_test "print *realp" "Cannot access memory at address 0x0" "print *realp, not associated"
5959 gdb_test "print \$my_var = intp" "= \\(PTR TO -> \\( $int \\)\\) 0x0"
60+set test "print cyclicp1, not associated"
61+gdb_test_multiple "print cyclicp1" $test {
62+ -re "= \\( i = -?\\d+, p = 0x0 \\)\r\n$gdb_prompt $" {
63+ pass $test
64+ }
65+ -re "= \\( i = -?\\d+, p = <not associated> \\)\r\n$gdb_prompt $" {
66+ pass $test
67+ }
68+}
69+set test "print cyclicp1%p, not associated"
70+gdb_test_multiple "print cyclicp1%p" $test {
71+ -re "= \\(PTR TO -> \\( Type typewithpointer \\)\\) 0x0\r\n$gdb_prompt $" {
72+ pass $test
73+ }
74+ -re "= \\(PTR TO -> \\( Type typewithpointer \\)\\) <not associated>\r\n$gdb_prompt $" {
75+ pass $test
76+ }
77+}
6078
6179
6280 gdb_breakpoint [gdb_get_line_number "Before value assignment"]
@@ -118,6 +136,8 @@ gdb_test_multiple "print *(arrayOfPtr(3)%p)" $test_name {
118136 pass $test_name
119137 }
120138 }
139+gdb_test "print cyclicp1" "= \\( i = 1, p = $hex\( <.*>\)? \\)"
140+gdb_test "print cyclicp1%p" "= \\(PTR TO -> \\( Type typewithpointer \\)\\) $hex\( <.*>\)?"
121141 gdb_test "print *((integer*) &inta + 2)" "= 3" "print temporary pointer, array"
122142 gdb_test "print *((integer*) &intvla + 3)" "= 4" "print temporary pointer, allocated vla"
123143 gdb_test "print \$pc" "= \\(PTR TO -> \\( void \\(\\)\\(\\)\\)\\) $hex <pointers\\+\\d+>" "Print program counter"
--- a/gdb/testsuite/gdb.fortran/pointers.f90
+++ b/gdb/testsuite/gdb.fortran/pointers.f90
@@ -20,6 +20,11 @@ program pointers
2020 integer, allocatable :: ivla2 (:, :)
2121 end type two
2222
23+ type :: typeWithPointer
24+ integer i
25+ type(typeWithPointer), pointer:: p
26+ end type typeWithPointer
27+
2328 type :: twoPtr
2429 type (two), pointer :: p
2530 end type twoPtr
@@ -34,6 +39,7 @@ program pointers
3439 real, target :: realv
3540 type(two), target :: twov
3641 type(twoPtr) :: arrayOfPtr (3)
42+ type(typeWithPointer), target:: cyclicp1,cyclicp2
3743
3844 logical, pointer :: logp
3945 complex, pointer :: comp
@@ -57,6 +63,8 @@ program pointers
5763 nullify (arrayOfPtr(1)%p)
5864 nullify (arrayOfPtr(2)%p)
5965 nullify (arrayOfPtr(3)%p)
66+ nullify (cyclicp1%p)
67+ nullify (cyclicp2%p)
6068
6169 logp => logv ! Before pointer assignment
6270 comp => comv
@@ -68,6 +76,10 @@ program pointers
6876 realp => realv
6977 twop => twov
7078 arrayOfPtr(2)%p => twov
79+ cyclicp1%i = 1
80+ cyclicp1%p => cyclicp2
81+ cyclicp2%i = 2
82+ cyclicp2%p => cyclicp1
7183
7284 logv = associated(logp) ! Before value assignment
7385 comv = cmplx(1,2)