Update year range in copyright notice of all files.
[external/binutils.git] / gas / testsuite / gas / tic4x / tic4x.exp
1 # Copyright (C) 2012-2017 Free Software Foundation, Inc.
2
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
7
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 # GNU General Public License for more details.
12
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software
15 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  
16
17 #
18 # Test x930509a -- correct assembly of differences involving forward
19 # references.
20 #
21 proc do_930509a_tic4x {} {
22     set testname "difference between forward references (tic4x version)"
23     set x 0
24     gas_start "../all/x930509.s" "-al"
25     while 1 {
26 # We need to accommodate both byte orders here.
27 # If ".long" means an 8-byte value on some target someday, this test will have
28 # to be fixed.
29         expect {
30             -re "^ +1 .... 00 ?00 ?00 ?00" { fail $testname; set x 1 }
31             -re "^ +1 .... 01 ?00 ?00 ?00" { pass $testname; set x 1 }
32             -re "^ +1 .... 00 ?00 ?00 ?01" { pass $testname; set x 1 }
33             -re "\[^\n\]*\n" { }
34             timeout { perror "timeout\n"; break }
35             eof { break }
36         }
37     }
38     gas_finish
39     if !$x then { fail $testname }
40 }
41
42
43 #
44 # TI TMS320C4X tests.
45 #
46 if [istarget *c4x*-*-*] then {
47     do_930509a_tic4x
48
49     # Test zero-based disassemble test
50     run_dump_test "zeros"
51
52     # Test the register names on the c3x and on the c4x
53     run_dump_test "registers_c3x"
54     run_dump_test "registers_c4x"
55
56     # Make sure the c4x registers don't work on c3x
57     gas_test_error "registers.s" "-m30 --defsym TEST_C4X=1" "c4x register usage in c3x"
58
59     # Test data storage
60     run_dump_test "data"
61
62     # Test flonums
63     run_dump_test "float"
64
65     # Test all addressing modes
66     run_dump_test "addressing_c3x"
67     run_dump_test "addressing_c4x"
68
69     # Make sure the c4x addressing don't work on c3x
70     gas_test_error "addressing.s" "-m30 --defsym TEST_C4X=1" "c4x addressing usage in c3x"
71
72     # Test float instructions
73     run_dump_test "opcodes_c3x"
74     run_dump_test "opcodes_c4x"
75     run_dump_test "opcodes_new"
76
77     # Make sure the c4x ops don't work on c3x
78     #gas_test_error "opcodes.s" "-m30 --defsym TEST_C4X=1" "c4x instruction usage in c3x"
79     #  -- for some reason this test crashes dejagnu, hence disabled!
80 }