ChangeLog rotatation and copyright year update
[deliverable/binutils-gdb.git] / gas / testsuite / gas / hppa / reloc / reloc.exp
index aa81bdd99eadcef04f2f8a36e564bbc43c678632..6247b6df94f275c16d7830b13101795e39cfb474 100644 (file)
@@ -1,8 +1,8 @@
-# Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc.
+# Copyright (C) 1993-2015 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
+# the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
 # 
 # This program is distributed in the hope that it will be useful,
 # 
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  
 
 # Please email any bugs, comments, and/or additions to this file to:
-# DejaGnu@cygnus.com
+# dejagnu@gnu.org
 
 # Written by the Center for Software Science at the University of Utah
 # and by Cygnus Support.
@@ -27,12 +27,14 @@ proc do_ble_relocation_test {} {
     if [gas_test_old "blebug.s" "" "Proper relocation for BLE (part 1)"] then {
        objdump_start_no_subdir "a.out" "-r"
 
-        if ![istarget hppa*-*-*elf*] then {
+        if {[istarget hppa*64*-*-*]
+           || [istarget hppa*-*-*elf*] || [istarget hppa*-*-linux*]} then {
            # At one time both versions of the assembler would incorrectly use 
            # a PC-relative relocation for a BLE instruction.
            while 1 {
                expect {
-                   -re "^0+4\[^\n\]*ABS_CALL\[^\n\]*\n"        { set x 1 }
+                   -re "^0+\[^\n\]*DIR21L\[^\n\]*\n"   { set x 1 }
+                   -re "^0+4\[^\n\]*DIR17R\[^\n\]*\n"  { set x 1 }
                    -re "\[^\n\]*\n"                            { }
                    timeout                     { perror "timeout\n"; break }
                    eof                         { break }
@@ -43,8 +45,7 @@ proc do_ble_relocation_test {} {
            # a PC-relative relocation for a BLE instruction.
            while 1 {
                expect {
-                   -re "^0+\[^\n\]*DIR21L\[^\n\]*\n"   { set x 1 }
-                   -re "^0+4\[^\n\]*DIR17R\[^\n\]*\n"  { set x 1 }
+                   -re "^0+4\[^\n\]*ABS_CALL\[^\n\]*\n"        { set x 1 }
                    -re "\[^\n\]*\n"                            { }
                    timeout                     { perror "timeout\n"; break }
                    eof                         { break }
@@ -65,8 +66,9 @@ proc do_relocation_reduction_tests {} {
     set testname "reduce.s: Test relocation reductions (part 2)"
     set x 0
 
-    if [istarget hppa*w-*-*] then {
-      return;
+    if {[istarget hppa*64*-*-*]
+        || [istarget hppa*-*-*elf*] || [istarget hppa*-*-linux*]} then {
+      return
     }
 
     if [gas_test_old "reduce.s" "" "Relocation reductions (part1)"] then {
@@ -242,8 +244,8 @@ proc do_selector_scope_test {} {
     set testname "selectorbug.s: Test scope of field selector" 
     set x 0
 
-    if [istarget hppa*w-*-*] then {
-      return;
+    if [istarget hppa*64*-*-*] then {
+      return
     }
 
     if [gas_test_old "selectorbug.s" "" "Test scope of field selector (part 1)"] {
@@ -252,7 +254,7 @@ proc do_selector_scope_test {} {
        # Check to make sure the relocation entry after the plabel is correct.
        # If an old field selector was incorrectly "carried" over, then 
        # this test will fail.
-        if [istarget hppa*-*-*elf*] then {
+        if {[istarget hppa*-*-*elf*] || [istarget hppa*-*-linux*]} then {
            while 1 {
                expect {
                    -re "^0+14\[^\n\]*DIR32\[^\n\]*\n"
@@ -294,18 +296,37 @@ proc do_local_label_as_operand_test {} {
     if [gas_test_old "labelopbug.s" "" "Local label as operand (part 1)"] {
        objdump_start_no_subdir "a.out" "-r"
 
-       # Check to make sure we handle difference of local lables as an operand
-       # to a non-branching instruction correctly.
-       while 1 {
-           expect {
-               -re "^0+2c\[^\n\]*0x0+24\[^\n\]*\n" 
-                   { set x [expr $x+1] }
-               -re "^0+30\[^\n\]*0x0+24\[^\n\]*\n" 
-                   { set x [expr $x+1] }
-               -re "\[^\n\]*\n"                { }
-               timeout                         { perror "timeout\n"; break }
-               eof                             { break }
-            }
+       # Check to make sure we handle difference of local labels as an operand
+       # to a non-branching instruction correctly.  On hppa elf targets, the
+       # R_PARISC_DIR21 and R_PARISC_DIR14R relocations are done with LR and
+       # RR selectors, respectively.  As a result, we can't reduce these to
+       # section offsets without risking incorrect rounding.  So, we just
+       # check to see if the label hasn't been reduced.
+       if {[istarget hppa*64*-*-*]
+           || [istarget hppa*-*-*elf*] || [istarget hppa*-*-linux*]} then {
+           while 1 {
+               expect {
+                   -re "^0+2c\[^\n\]*L.0002\[^\n\]*\n" 
+                       { set x [expr $x+1] }
+                   -re "^0+30\[^\n\]*L.0002\[^\n\]*\n" 
+                       { set x [expr $x+1] }
+                   -re "\[^\n\]*\n"            { }
+                   timeout                     { perror "timeout\n"; break }
+                   eof                         { break }
+               }
+           }
+       } else {
+           while 1 {
+               expect {
+                   -re "^0+2c\[^\n\]*0x0+24\[^\n\]*\n" 
+                       { set x [expr $x+1] }
+                   -re "^0+30\[^\n\]*0x0+24\[^\n\]*\n" 
+                       { set x [expr $x+1] }
+                   -re "\[^\n\]*\n"            { }
+                   timeout                     { perror "timeout\n"; break }
+                   eof                         { break }
+               }
+           }
        }
 
        # This was intended to do any cleanup necessary.  It kinda looks like it
@@ -324,9 +345,10 @@ proc do_exit_relocation_test {} {
     # Elf (osf) does not use ENTRY/EXIT relocations.
     # I guess we could look at the unwind subspaces it builds...
     # Until then, make sure it still assembles.
-    if [istarget hppa*-*-*elf*] then {
+    if {[istarget hppa*64*-*-*]
+       || [istarget hppa*-*-*elf*] || [istarget hppa*-*-linux*]} then {
        gas_test_old "exitbug.s" "" "Test for bogus R_EXIT relocation (part 1)"
-       return;
+       return
     }
 
     if [gas_test_old "exitbug.s" "" "Test for bogus R_EXIT relocation (part 1)"] {
@@ -356,13 +378,10 @@ proc do_cross_space_fixup_test_1 {} {
     set testname "fixupbug.s: Test cross space jump/call fixup bug (part 2)"
     set x 0
 
-    if [istarget hppa*w-*-*] then {
-      return;
-    }
-
-    # ELF (osf) doesn't really handle extra sections too well...
-    if [istarget hppa*-*-*elf*] then {
-       return;
+    # ELF doesn't really handle extra sections too well...
+    if {[istarget hppa*64*-*-*]
+       || [istarget hppa*-*-*elf*] || [istarget hppa*-*-linux*]} then {
+       return
     }
 
     if [gas_test_old "fixupbug.s" "" "Test cross space jump/call fixup bug (part 1)"] {
@@ -393,13 +412,10 @@ proc do_cross_space_fixup_test_2 {} {
     set testname "fixupbug.s: Test cross space jump/call fixup bug (part 3)"
     set x 0
 
-    if [istarget hppa*w-*-*] then {
-      return;
-    }
-
-    # ELF (osf) doesn't really handle extra sections too well...
-    if [istarget hppa*-*-*elf*] then {
-       return;
+    # ELF doesn't really handle extra sections too well...
+    if {[istarget hppa*64*-*-*]
+       || [istarget hppa*-*-*elf*] || [istarget hppa*-*-linux*]} then {
+       return
     }
 
     gas_start "fixupbug.s" "-al"
@@ -431,7 +447,8 @@ proc do_round_mode_test {} {
        # Make sure GAS generated correct relocations to switch rounding modes.
        # Also make sure (for SOM) that redundant rounding mode relocations
        # were eliminated.
-       if { [istarget hppa*-*-*elf*] || [istarget hppa*w-*-*] } then {
+       if {[istarget hppa*64*-*-*]
+           || [istarget hppa*-*-*elf*] || [istarget hppa*-*-linux*]} then {
            while 1 {
                expect {
                    -re "^0+\[^\n\]*DIR21L\[^\n\]*\n"
@@ -484,7 +501,8 @@ proc do_round_mode_test {} {
        objdump_finish
 
        # Did we find what we were looking for?  If not, flunk it.
-       if {[istarget hppa*-*-*elf*] || [istarget hppa*w-*-*] } then {
+       if {[istarget hppa*64*-*-*]
+           || [istarget hppa*-*-*elf*] || [istarget hppa*-*-linux*]} then {
            if [expr $x==8] then { pass $testname } else { fail $testname }
        } else {
            if [expr $x==3] then { pass $testname } else { fail $testname }
@@ -527,7 +545,7 @@ proc do_function_reloc_bug {} {
        # Make sure we didn't put anything in the instruction itself!
        while 1 {
            expect {
-               -re "^0+cc\[^\n\]*ldil 0,r20\[^\n\]*\n" 
+               -re "^0+cc\[^\n\]*ldil L%0,r20\[^\n\]*\n" 
                    { set x [expr $x+1] }
                -re "^0+d0\[^\n\]*ldo 0\[\(\]+r20\[\)\]+,r19\[^\n\]*\n" 
                    { set x [expr $x+1] }
@@ -579,13 +597,10 @@ proc do_pic_relocation_test {} {
     set testname "picreloc.s: Test for proper PIC relocation (part 2)"
     set x 0
 
-    if [istarget hppa*w-*-*] then {
-      return;
-    }
-
-    # ELF (osf) doesn't really handle extra sections too well...
-    if [istarget hppa*-*-*elf*] then {
-       return;
+    # ELF doesn't really handle extra sections too well...
+    if {[istarget hppa*64*-*-*]
+       || [istarget hppa*-*-*elf*] || [istarget hppa*-*-linux*]} then {
+       return
     }
 
     gas_start "picreloc.s" "-al"
@@ -608,21 +623,22 @@ proc do_pic_relocation_test {} {
 }
 
 proc do_apply_test {} {
-    set testname "applybug.s: Test for proper fixup appliation (part 2)"
+    set testname "applybug.s: Test for proper fixup application (part 2)"
     set x 0
 
-    # ELF (osf) doesn't really handle extra sections too well...
-    if [istarget hppa*-*-*elf*] then {
-       return;
+    # ELF doesn't really handle extra sections too well...
+    if {[istarget hppa*64*-*-*]
+       || [istarget hppa*-*-*elf*] || [istarget hppa*-*-linux*]} then {
+       return
     }
 
     gas_start "applybug.s" "-al"
 
     while 1 {
        expect {
-           -re "^ +\[0-9\]+ 0000 00000000\[^\n\]*\n"   { set x [expr $x+1] }
-           -re "^ +\[0-9\]+ 0004 00000000\[^\n\]*\n"   { set x [expr $x+1] }
-           -re "^ +\[0-9\]+ 0008 00000000\[^\n\]*\n"   { set x [expr $x+1] }
+           -re "^ +\[0-9\]+ 0000 00000044\[^\n\]*\n"   { set x [expr $x+1] }
+           -re "^ +\[0-9\]+ 0004 00000058\[^\n\]*\n"   { set x [expr $x+1] }
+           -re "^ +\[0-9\]+ 0008 0000006C\[^\n\]*\n"   { set x [expr $x+1] }
            -re "\[^\n\]*\n"                            { }
            timeout                             { perror "timeout\n"; break }
            eof                                 { break }
@@ -636,6 +652,7 @@ proc do_apply_test {} {
     # Did we find what we were looking for?  If not, flunk it.
     if [expr $x==3] then { pass $testname } else { fail $testname }
 }
+
 if [istarget hppa*-*-*] then {
     # Make sure we put the right relocation entry on a BLE instruction.
     do_ble_relocation_test
This page took 0.027638 seconds and 4 git commands to generate.