aboutsummaryrefslogtreecommitdiff
path: root/src/test/run-pass/alt-pattern-lit.rs
diff options
context:
space:
mode:
authorBrian Anderson <[email protected]>2011-03-07 21:21:01 -0500
committerBrian Anderson <[email protected]>2011-03-07 21:21:01 -0500
commit9fc4db6b89213afdf45c02fc2bd2be62b0ddc40c (patch)
tree6c84574116273f91cbe89abd256b9f809adf97de /src/test/run-pass/alt-pattern-lit.rs
parentAllow the else part of an expr_if to be either expr_if or expr_block (diff)
parentrustc: Cast the LLVM representations of tag types when constructing boxes. Un... (diff)
downloadrust-9fc4db6b89213afdf45c02fc2bd2be62b0ddc40c.tar.xz
rust-9fc4db6b89213afdf45c02fc2bd2be62b0ddc40c.zip
Merge branch 'master' into recursive-elseif
Conflicts: src/Makefile src/comp/front/ast.rs src/comp/front/parser.rs src/comp/middle/fold.rs src/comp/middle/trans.rs
Diffstat (limited to 'src/test/run-pass/alt-pattern-lit.rs')
-rw-r--r--src/test/run-pass/alt-pattern-lit.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/run-pass/alt-pattern-lit.rs b/src/test/run-pass/alt-pattern-lit.rs
new file mode 100644
index 00000000..91190260
--- /dev/null
+++ b/src/test/run-pass/alt-pattern-lit.rs
@@ -0,0 +1,17 @@
+fn altlit(int f) -> int {
+ alt (f) {
+ case (10) {
+ log "case 10";
+ ret 20;
+ }
+ case (11) {
+ log "case 11";
+ ret 22;
+ }
+ }
+}
+
+fn main() {
+ check (altlit(10) == 20);
+ check (altlit(11) == 22);
+}