diff options
author | mfortune <matthew.fortune@imgtec.com> | 2014-05-20 13:28:20 +0100 |
---|---|---|
committer | mfortune <matthew.fortune@imgtec.com> | 2014-05-20 23:46:43 +0100 |
commit | 919731affbef19fcad8dddb0a595bb05755cb345 (patch) | |
tree | bace9d17f11966117a29ef86360429c4679d3a0b /gas/testsuite | |
parent | 153ff4340d8d2a4ddd53cf953e19aeef3bb7d5dc (diff) | |
download | gdb-919731affbef19fcad8dddb0a595bb05755cb345.zip gdb-919731affbef19fcad8dddb0a595bb05755cb345.tar.gz gdb-919731affbef19fcad8dddb0a595bb05755cb345.tar.bz2 |
Add MIPS .module directive
gas/
* config/tc-mips.c (file_mips_opts_checked): New static global.
(s_module): New static function.
(file_ase): Remove.
(mips_pseudo_table): Add .module handler.
(mips_set_ase): Add opts argument and use instead of mips_opts.
(md_assemble): Use file_mips_check_options.
(md_parse_option): Update to use file_mips_opts instead of mips_opts.
(mips_set_architecture): Delete function. Moved to...
(mips_after_parse_args): Here. All logic now applies to
file_mips_opts first and then copies the final state to mips_opts.
Move error checking and defaults inference to mips_check_options and
file_mips_check_options.
(mips_check_options): New static function. Common option checking for
command line, .module and .set. Use .module values in error messages
instead of refering to command line options.
(file_mips_check_options): New static function. A wrapper for
mips_check_options with file_mips_opts. Updates BFD arch based on
final options.
(s_mipsset): Split into s_mipsset and parse_code_option. Settings
supported by both .set and .module are moved to parse_code_option.
Warnings and errors are kept in s_mipsset because when
parse_code_option is used with s_module the warnings are deferred
until code is generated. Any setting supporting 'default' value is
kept in s_mipsset as it is not applicable to s_module. Inferred
settings are also kept in s_mipsset as s_module does not infer any
settings. Use mips_check_options.
(parse_code_option): New static function derived from s_mipsset.
(s_module): New static function that implements .module. Allows file
level settings to be changed until code is generated.
(s_cpload, s_cpsetup, s_cplocal): Use file_mips_check_options.
(s_cprestore, s_cpreturn, s_cpadd, mips_address_bytes): Likewise.
(mips_elf_final_processing): Update file_ase to file_mips_opts.ase.
(md_mips_end): Use file_mips_check_options.
* doc/c-mips.texi: Document .module.
gas/testsuite
* gas/mips/mips.exp: Add new tests. Use 64-bit ABI for relax-bc1any.
Fix micromips arch definition to use mips64r2 consistently.
* gas/mips/module-defer-warn1.s: New.
* gas/mips/module-defer-warn1.d: New.
* gas/mips/module-defer-warn2.s: New.
* gas/mips/module-defer-warn2.l: New.
* gas/mips/module-override.d: New.
* gas/mips/module-override.s: New.
* gas/mips/mips-gp32-fp64.l: Update expected output.
* gas/mips/mips-gp64-fp32-pic.l: Update expected output.
* gas/mips/mips-gp64-fp32.l: Update expected output.
Diffstat (limited to 'gas/testsuite')
-rw-r--r-- | gas/testsuite/gas/mips/mips-gp32-fp64.l | 4 | ||||
-rw-r--r-- | gas/testsuite/gas/mips/mips-gp64-fp32-pic.l | 4 | ||||
-rw-r--r-- | gas/testsuite/gas/mips/mips-gp64-fp32.l | 4 | ||||
-rw-r--r-- | gas/testsuite/gas/mips/mips.exp | 8 | ||||
-rw-r--r-- | gas/testsuite/gas/mips/module-defer-warn1.d | 7 | ||||
-rw-r--r-- | gas/testsuite/gas/mips/module-defer-warn1.s | 2 | ||||
-rw-r--r-- | gas/testsuite/gas/mips/module-defer-warn2.l | 3 | ||||
-rw-r--r-- | gas/testsuite/gas/mips/module-defer-warn2.s | 2 | ||||
-rw-r--r-- | gas/testsuite/gas/mips/module-override.d | 7 | ||||
-rw-r--r-- | gas/testsuite/gas/mips/module-override.s | 1 |
10 files changed, 34 insertions, 8 deletions
diff --git a/gas/testsuite/gas/mips/mips-gp32-fp64.l b/gas/testsuite/gas/mips/mips-gp32-fp64.l index de3f3b0..82b7b17 100644 --- a/gas/testsuite/gas/mips/mips-gp32-fp64.l +++ b/gas/testsuite/gas/mips/mips-gp32-fp64.l @@ -1,2 +1,2 @@ -Assembler messages: -Warning: -mfp64 used with a 32-bit ABI +.*Assembler messages: +.* Warning: `fp=64' used with a 32-bit ABI diff --git a/gas/testsuite/gas/mips/mips-gp64-fp32-pic.l b/gas/testsuite/gas/mips/mips-gp64-fp32-pic.l index 2d37303..a02481a 100644 --- a/gas/testsuite/gas/mips/mips-gp64-fp32-pic.l +++ b/gas/testsuite/gas/mips/mips-gp64-fp32-pic.l @@ -1,2 +1,2 @@ -Assembler messages: -Warning: -mfp32 used with a 64-bit ABI +.*Assembler messages: +.*:16: Warning: `fp=32' used with a 64-bit ABI diff --git a/gas/testsuite/gas/mips/mips-gp64-fp32.l b/gas/testsuite/gas/mips/mips-gp64-fp32.l index e72f085..5fd9e34 100644 --- a/gas/testsuite/gas/mips/mips-gp64-fp32.l +++ b/gas/testsuite/gas/mips/mips-gp64-fp32.l @@ -1,5 +1,5 @@ -Assembler messages: -Warning: -mfp32 used with a 64-bit ABI +.*Assembler messages: +.* Warning: `fp=32' used with a 64-bit ABI .*:92: Warning: macro instruction expanded into multiple instructions in a branch delay slot .*:96: Warning: macro instruction expanded into multiple instructions in a branch delay slot .*:100: Warning: macro instruction expanded into multiple instructions in a branch delay slot diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp index 7ccbed5..c3135ca 100644 --- a/gas/testsuite/gas/mips/mips.exp +++ b/gas/testsuite/gas/mips/mips.exp @@ -442,7 +442,7 @@ mips_arch_create mips64r5 64 mips64r3 { mips32r5 ror } \ mips_arch_create mips16 32 {} {} \ { -march=mips1 -mips16 } { -mmips:16 } mips_arch_create micromips 64 mips64r2 {} \ - { -march=mips64 -mmicromips } {} + { -march=mips64r2 -mmicromips } {} mips_arch_create r3000 32 mips1 {} \ { -march=r3000 -mtune=r3000 } { -mmips:3000 } mips_arch_create r3900 32 mips1 { gpr_ilocks } \ @@ -787,7 +787,7 @@ if { [istarget mips*-*-vxworks*] } { run_dump_test "relax-swap1-mips2" run_dump_test "relax-swap2" run_dump_test_arches "relax-swap3" [mips_arch_list_all] - run_list_test_arches "relax-bc1any" "-mips3d -relax-branch" \ + run_list_test_arches "relax-bc1any" "-mips3d -mabi=o64 -relax-branch" \ [mips_arch_list_matching mips64 \ !micromips] run_list_test_arches "relax-bposge" "-mdsp -relax-branch" \ @@ -1200,4 +1200,8 @@ if { [istarget mips*-*-vxworks*] } { run_dump_test "attr-gnu-abi-fp-1" run_dump_test "attr-gnu-abi-msa-1" + + run_dump_test "module-override" + run_dump_test "module-defer-warn1" + run_list_test "module-defer-warn2" -32 } diff --git a/gas/testsuite/gas/mips/module-defer-warn1.d b/gas/testsuite/gas/mips/module-defer-warn1.d new file mode 100644 index 0000000..d5ee70e --- /dev/null +++ b/gas/testsuite/gas/mips/module-defer-warn1.d @@ -0,0 +1,7 @@ +# name: .module deferred warnings +# source: module-defer-warn1.s +# objdump: -p +# as: -32 -march=mips2 -mgp64 + +.*:.*file format.*elf.*mips.* +private flags = 1.......: .*\[mips2\].* diff --git a/gas/testsuite/gas/mips/module-defer-warn1.s b/gas/testsuite/gas/mips/module-defer-warn1.s new file mode 100644 index 0000000..d9cbf39 --- /dev/null +++ b/gas/testsuite/gas/mips/module-defer-warn1.s @@ -0,0 +1,2 @@ +.module gp=32 +addiu $2, $2, 1 diff --git a/gas/testsuite/gas/mips/module-defer-warn2.l b/gas/testsuite/gas/mips/module-defer-warn2.l new file mode 100644 index 0000000..f03ad48 --- /dev/null +++ b/gas/testsuite/gas/mips/module-defer-warn2.l @@ -0,0 +1,3 @@ +.*: Assembler messages: +.*:2: Error: `gp=64' used with a 32-bit processor +.*:2: Error: `fp=64' used with a 32-bit fpu diff --git a/gas/testsuite/gas/mips/module-defer-warn2.s b/gas/testsuite/gas/mips/module-defer-warn2.s new file mode 100644 index 0000000..f7353e5 --- /dev/null +++ b/gas/testsuite/gas/mips/module-defer-warn2.s @@ -0,0 +1,2 @@ +.module gp=64 +addiu $2, $2, 1 diff --git a/gas/testsuite/gas/mips/module-override.d b/gas/testsuite/gas/mips/module-override.d new file mode 100644 index 0000000..0305b02 --- /dev/null +++ b/gas/testsuite/gas/mips/module-override.d @@ -0,0 +1,7 @@ +# name: .module command line override +# source: module-override.s +# objdump: -p +# as: -32 -march=mips32r2 + +.*:.*file format.*elf.*mips.* +private flags = 1.......: .*\[mips2\].* diff --git a/gas/testsuite/gas/mips/module-override.s b/gas/testsuite/gas/mips/module-override.s new file mode 100644 index 0000000..05f4a17 --- /dev/null +++ b/gas/testsuite/gas/mips/module-override.s @@ -0,0 +1 @@ +.module mips2 |