aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2024-09-11 13:56:36 +0200
committerJan Beulich <jbeulich@suse.com>2024-09-11 13:56:36 +0200
commit6fc346a4b39f7658e99522529308a23b8543ffe3 (patch)
tree7be76ed44066c886ee2fdfb4ce9811efb506dc8f /gas/testsuite
parent5d2142f10e70183d438a6a85c40aba66c8abc099 (diff)
downloadgdb-6fc346a4b39f7658e99522529308a23b8543ffe3.zip
gdb-6fc346a4b39f7658e99522529308a23b8543ffe3.tar.gz
gdb-6fc346a4b39f7658e99522529308a23b8543ffe3.tar.bz2
gas: avoid (scrubber) diagnostics for stuff past .end
What's past an active .end directive (when that has its default purpose) is supposed to be entirely ignored. That should be true not just for regular processing, but also for "pre-processing" (aka scrubbing). A complication is that such a directive may of course occur inside a (false) conditional or a macro definition. To deal with that make sure we can continue as usual if called another time. Note however that .end inside a macro will still have the full macro body expanded; dealing with that would require further (perhaps intrusive) adjustments in sb_scrub_and_add_sb() and/or callers thereof. However, at least some of the warnings issued by do_scrub_chars() are unlikely to occur when expanding a macro. (If we needed to go that far, presumably .exitm would also want recognizing.)
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/gas/all/end-no-dot.l3
-rw-r--r--gas/testsuite/gas/all/end-no-dot.s11
-rw-r--r--gas/testsuite/gas/all/end.l3
-rw-r--r--gas/testsuite/gas/all/end.s11
-rw-r--r--gas/testsuite/gas/all/gas.exp24
5 files changed, 52 insertions, 0 deletions
diff --git a/gas/testsuite/gas/all/end-no-dot.l b/gas/testsuite/gas/all/end-no-dot.l
new file mode 100644
index 0000000..fa47ae3
--- /dev/null
+++ b/gas/testsuite/gas/all/end-no-dot.l
@@ -0,0 +1,3 @@
+# No diagnostics should appear for anything past "end".
+>3<
+>4<
diff --git a/gas/testsuite/gas/all/end-no-dot.s b/gas/testsuite/gas/all/end-no-dot.s
new file mode 100644
index 0000000..bee10c8
--- /dev/null
+++ b/gas/testsuite/gas/all/end-no-dot.s
@@ -0,0 +1,11 @@
+ if 0
+ end a b c
+ endif
+
+ irpc n,34
+ print ">\n<"
+ endr
+
+ end q r, s
+ "\z"
+ äöü'\ \ No newline at end of file
diff --git a/gas/testsuite/gas/all/end.l b/gas/testsuite/gas/all/end.l
new file mode 100644
index 0000000..e18518d
--- /dev/null
+++ b/gas/testsuite/gas/all/end.l
@@ -0,0 +1,3 @@
+# No diagnostics should appear for anything past .end.
+>1<
+>2<
diff --git a/gas/testsuite/gas/all/end.s b/gas/testsuite/gas/all/end.s
new file mode 100644
index 0000000..3090792
--- /dev/null
+++ b/gas/testsuite/gas/all/end.s
@@ -0,0 +1,11 @@
+ .if 0
+ .end a b c
+ .endif
+
+ .irpc n,12
+ .print ">\n<"
+ .endr
+
+ .end q r, s
+ "\z"
+ äöü'\ \ No newline at end of file
diff --git a/gas/testsuite/gas/all/gas.exp b/gas/testsuite/gas/all/gas.exp
index 45d037c..5fff61f 100644
--- a/gas/testsuite/gas/all/gas.exp
+++ b/gas/testsuite/gas/all/gas.exp
@@ -464,6 +464,30 @@ switch -glob $target_triplet {
run_dump_test weakref1w
}
}
+
+# .end works differently on some targets. Also make sure to test the dot-less
+# form on targets setting NO_PSEUDO_DOT (and not overriding the directive).
+switch -glob $target_triplet {
+ alpha*-*-* { }
+ hppa*-*-* { }
+ iq2000-*-* { }
+ microblaze-*-* { }
+ mips*-*-* { }
+ score*-*-* { }
+ xtensa*-*-* { }
+ m68hc1*-*-* -
+ s12z-*-* -
+ spu-*-* -
+ xgate-*-* -
+ z80-*-* {
+ run_list_test "end"
+ run_list_test "end-no-dot"
+ }
+ default {
+ run_list_test "end"
+ }
+}
+
gas_test_error "weakref2.s" "" "e: would close weakref loop: e => a => b => c => d => e"
gas_test_error "weakref3.s" "" "a: would close weakref loop: a => b => c => d => e => a"
gas_test_error "weakref4.s" "" "is already defined"