rust_error_at (expr.get_locus (), "bad number in literal");
return error_mark_node;
}
+ if (expr.is_negative ())
+ mpfr_neg (fval, fval, MPFR_RNDN);
// taken from:
// see go/gofrontend/expressions.cc:check_float_type
bool error_E0579 = false;
if (TREE_CODE (upper) == REAL_CST)
{
- REAL_VALUE_TYPE upper_r = TREE_REAL_CST (upper);
- REAL_VALUE_TYPE lower_r = TREE_REAL_CST (lower);
- if (real_compare (GE_EXPR, &lower_r, &upper_r))
+ const REAL_VALUE_TYPE *upper_r = TREE_REAL_CST_PTR (upper);
+ const REAL_VALUE_TYPE *lower_r = TREE_REAL_CST_PTR (lower);
+ if (real_compare (GE_EXPR, lower_r, upper_r))
error_E0579 = true;
}
else if (TREE_CODE (upper) == INTEGER_CST)
--- /dev/null
+#![feature(exclusive_range_pattern)]
+
+fn main() {
+ let x = 1.0;
+
+ match x { // { dg-message "sorry, unimplemented: match on floating-point types is not yet supported" }
+ -1.0f32..-1.2f32 => 2, // { dg-error "lower range bound must be less than upper .E0579." }
+ };
+}
\ No newline at end of file
--- /dev/null
+#![feature(exclusive_range_pattern)]
+
+fn main() {
+ let x = 1.0;
+
+ match x { // { dg-message "sorry, unimplemented: match on floating-point types is not yet supported" }
+ -1.2f32..-1.0f32 => 2,
+ };
+}
\ No newline at end of file