+void
+s_elseif (int arg)
+{
+ if (current_cframe == NULL)
+ {
+ as_bad (_("\".elseif\" without matching \".if\""));
+ }
+ else if (current_cframe->else_seen)
+ {
+ as_bad (_("\".elseif\" after \".else\""));
+ as_bad_where (current_cframe->else_file_line.file,
+ current_cframe->else_file_line.line,
+ _("here is the previous \".else\""));
+ as_bad_where (current_cframe->if_file_line.file,
+ current_cframe->if_file_line.line,
+ _("here is the previous \".if\""));
+ }
+ else
+ {
+ as_where (¤t_cframe->else_file_line.file,
+ ¤t_cframe->else_file_line.line);
+
+ current_cframe->dead_tree |= !current_cframe->ignoring;
+ current_cframe->ignoring = current_cframe->dead_tree;
+ }
+
+ if (current_cframe == NULL || current_cframe->ignoring)
+ {
+ while (! is_end_of_line[(unsigned char) *input_line_pointer])
+ ++input_line_pointer;
+
+ if (current_cframe == NULL)
+ return;
+ }
+ else
+ {
+ expressionS operand;
+ int t;
+
+ /* Leading whitespace is part of operand. */
+ SKIP_WHITESPACE ();
+
+ expression_and_evaluate (&operand);
+ if (operand.X_op != O_constant)
+ as_bad (_("non-constant expression in \".elseif\" statement"));
+
+ switch ((operatorT) arg)
+ {
+ case O_eq: t = operand.X_add_number == 0; break;
+ case O_ne: t = operand.X_add_number != 0; break;
+ case O_lt: t = operand.X_add_number < 0; break;
+ case O_le: t = operand.X_add_number <= 0; break;
+ case O_ge: t = operand.X_add_number >= 0; break;
+ case O_gt: t = operand.X_add_number > 0; break;
+ default:
+ abort ();
+ return;
+ }
+
+ current_cframe->ignoring = current_cframe->dead_tree || ! t;
+ }
+
+ if (LISTING_SKIP_COND ()
+ && (current_cframe->previous_cframe == NULL
+ || ! current_cframe->previous_cframe->ignoring))
+ {
+ if (! current_cframe->ignoring)
+ listing_list (1);
+ else
+ listing_list (2);
+ }
+
+ demand_empty_rest_of_line ();
+}
+
+void
+s_endif (int arg ATTRIBUTE_UNUSED)