summaryrefslogtreecommitdiff
path: root/gas/cond.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2005-05-06 06:38:11 +0000
committerJan Beulich <jbeulich@novell.com>2005-05-06 06:38:11 +0000
commitb81d7e86b21cee7fc288f48bf9836712cc96717f (patch)
tree554ef016396cc0a152e1d6b2b83516bbcbe7a6fc /gas/cond.c
parent8ca4eaf3632222f5cc0b9e61afd80b01d6390c7c (diff)
downloadbinutils-redhat-b81d7e86b21cee7fc288f48bf9836712cc96717f.tar.gz
gas/
2005-05-06 Jan Beulich <jbeulich@novell.com> * cond.c (s_ifb): New. * read.c (potable): Add s_ifb as handler for .ifb and .ifnb. * read.h (s_ifb): Prototype. * doc/as.texinfo: Document .ifb and .ifnb. gas/testsuite/ 2005-05-06 Jan Beulich <jbeulich@novell.com> * gas/all/cond.s: Also test .ifb/.ifnb. * gas/all/cond.d: Adjust.
Diffstat (limited to 'gas/cond.c')
-rw-r--r--gas/cond.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/gas/cond.c b/gas/cond.c
index 8bea97e412..8cd98c2a2d 100644
--- a/gas/cond.c
+++ b/gas/cond.c
@@ -181,6 +181,40 @@ s_if (int arg)
demand_empty_rest_of_line ();
}
+/* Performs the .ifb (test_blank == 1) and
+ the .ifnb (test_blank == 0) pseudo op. */
+
+void
+s_ifb (int test_blank)
+{
+ struct conditional_frame cframe;
+
+ initialize_cframe (&cframe);
+
+ if (cframe.dead_tree)
+ cframe.ignoring = 1;
+ else
+ {
+ int is_eol;
+
+ SKIP_WHITESPACE ();
+ is_eol = is_end_of_line[(unsigned char) *input_line_pointer];
+ cframe.ignoring = (test_blank == !is_eol);
+ }
+
+ current_cframe = ((struct conditional_frame *)
+ obstack_copy (&cond_obstack, &cframe,
+ sizeof (cframe)));
+
+ if (LISTING_SKIP_COND ()
+ && cframe.ignoring
+ && (cframe.previous_cframe == NULL
+ || ! cframe.previous_cframe->ignoring))
+ listing_list (2);
+
+ ignore_rest_of_line ();
+}
+
/* Get a string for the MRI IFC or IFNC pseudo-ops. */
static char *