diff options
author | Claudiu Zissulescu <claziss@synopsys.com> | 2016-11-17 13:26:54 +0100 |
---|---|---|
committer | Claudiu Zissulescu <claziss@synopsys.com> | 2016-11-18 14:29:48 +0100 |
commit | bb050a6932c4b0ea86202fe62bed2d94999f77ad (patch) | |
tree | f610c347bb4464491521d5f0bc8077b96a38470b /gas/testsuite | |
parent | cc133f9f118ef4afd93da0ecba48151488c41c74 (diff) | |
download | gdb-bb050a6932c4b0ea86202fe62bed2d94999f77ad.zip gdb-bb050a6932c4b0ea86202fe62bed2d94999f77ad.tar.gz gdb-bb050a6932c4b0ea86202fe62bed2d94999f77ad.tar.bz2 |
[ARC] Fix and extend features of .cpu directive.
gas/
2016-11-18 Claudiu Zissulescu <claziss@synopsys.com>
* testsuite/gas/arc/cl-warn.s: New file.
* testsuite/gas/arc/cpu-pseudop-1.d: Likewise.
* testsuite/gas/arc/cpu-pseudop-1.s: Likewise.
* testsuite/gas/arc/cpu-pseudop-2.d: Likewise.
* testsuite/gas/arc/cpu-pseudop-2.s: Likewise.
* testsuite/gas/arc/cpu-warn2.s: Likewise.
* config/tc-arc.c (selected_cpu): Initialize.
(feature_type): New struct.
(feature_list): New variable.
(arc_check_feature): New function.
(arc_select_cpu): Check for .cpu duplicates. Don't overwrite the
current cpu features. Check if a feature is available for a given
cpu.
(md_parse_option): Test if features are available for a given cpu.
Diffstat (limited to 'gas/testsuite')
-rw-r--r-- | gas/testsuite/gas/arc/cl-warn.s | 5 | ||||
-rw-r--r-- | gas/testsuite/gas/arc/cpu-pseudop-1.d | 12 | ||||
-rw-r--r-- | gas/testsuite/gas/arc/cpu-pseudop-1.s | 6 | ||||
-rw-r--r-- | gas/testsuite/gas/arc/cpu-pseudop-2.d | 11 | ||||
-rw-r--r-- | gas/testsuite/gas/arc/cpu-pseudop-2.s | 5 | ||||
-rw-r--r-- | gas/testsuite/gas/arc/cpu-warn2.s | 4 |
6 files changed, 43 insertions, 0 deletions
diff --git a/gas/testsuite/gas/arc/cl-warn.s b/gas/testsuite/gas/arc/cl-warn.s new file mode 100644 index 0000000..63199cf --- /dev/null +++ b/gas/testsuite/gas/arc/cl-warn.s @@ -0,0 +1,5 @@ +; Test command line option compatibility checking. +; { dg-do assemble } +; { dg-options "--mcpu=archs -mdpfp" } +; { dg-error ".* invalid double-precision FPX option for archs cpu" "" { target arc*-*-* } 0 } + nop diff --git a/gas/testsuite/gas/arc/cpu-pseudop-1.d b/gas/testsuite/gas/arc/cpu-pseudop-1.d new file mode 100644 index 0000000..09c47c9 --- /dev/null +++ b/gas/testsuite/gas/arc/cpu-pseudop-1.d @@ -0,0 +1,12 @@ +#as: -mcpu=arcem -mcode-density -mdpfp +#objdump: -dp -M dpfp + +.*: +file format .*arc.* +private flags = 0x305: -mcpu=ARCv2EM .* + + +Disassembly of section .text: + +00000000 <.text>: + 0: 4af7 sub_s r15,r2,r15 + 2: 3211 00c1 dsubh12 r1,r2,r3 diff --git a/gas/testsuite/gas/arc/cpu-pseudop-1.s b/gas/testsuite/gas/arc/cpu-pseudop-1.s new file mode 100644 index 0000000..40217aa --- /dev/null +++ b/gas/testsuite/gas/arc/cpu-pseudop-1.s @@ -0,0 +1,6 @@ +;;; Check if user can use additional command line options. + .cpu EM + .section .text + + sub_s r15,r2,r15 ;code density instruction + dsubh12 r1,r2,r3 ;double-precision instruction diff --git a/gas/testsuite/gas/arc/cpu-pseudop-2.d b/gas/testsuite/gas/arc/cpu-pseudop-2.d new file mode 100644 index 0000000..3bde329 --- /dev/null +++ b/gas/testsuite/gas/arc/cpu-pseudop-2.d @@ -0,0 +1,11 @@ +#as: -mcpu=archs +#objdump: -dp + +.*: +file format .*arc.* +private flags = 0x306: -mcpu=ARCv2HS .* + + +Disassembly of section .text: + +00000000 <.text>: + 0: 4af7 sub_s r15,r2,r15 diff --git a/gas/testsuite/gas/arc/cpu-pseudop-2.s b/gas/testsuite/gas/arc/cpu-pseudop-2.s new file mode 100644 index 0000000..def89d6 --- /dev/null +++ b/gas/testsuite/gas/arc/cpu-pseudop-2.s @@ -0,0 +1,5 @@ +;;; Check if user can use additional command line options. + .cpu EM + .section .text + + sub_s r15,r2,r15 ;code density instruction diff --git a/gas/testsuite/gas/arc/cpu-warn2.s b/gas/testsuite/gas/arc/cpu-warn2.s new file mode 100644 index 0000000..e9ee338 --- /dev/null +++ b/gas/testsuite/gas/arc/cpu-warn2.s @@ -0,0 +1,4 @@ +; Test warnings when multiple .cpu pseudo-ops are defined. +; { dg-do assemble } + .cpu EM + .cpu HS ;{ dg-error "Error: Multiple .cpu directives found" } |