diff --git a/src/test/run-pass/expr-if-box.rs b/src/test/run-pass/expr-if-box.rs new file mode 100644 index 00000000000..98503211fc2 --- /dev/null +++ b/src/test/run-pass/expr-if-box.rs @@ -0,0 +1,14 @@ +// xfail-boot +// xfail-stage0 +// -*- rust -*- + +// Tests for if as expressions returning boxed types + +fn test_box() { + auto res = if (true) { @100 } else { @101 }; + check (*res == 100); +} + +fn main() { + test_box(); +} \ No newline at end of file