Skip to content

Commit

Permalink
Add run-make test
Browse files Browse the repository at this point in the history
  • Loading branch information
sinkuu committed Mar 21, 2017
1 parent c4948e7 commit 2d17aff
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/test/run-make/save-analysis/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
all: code
krate2: krate2.rs
$(RUSTC) $<
code: foo.rs krate2
code: foo.rs krate2 sugar.rs
$(RUSTC) foo.rs -Zsave-analysis-csv
$(RUSTC) foo.rs -Zsave-analysis
$(RUSTC) foo.rs -Zsave-analysis-api
$(RUSTC) sugar.rs -Zsave-analysis-csv
30 changes: 30 additions & 0 deletions src/test/run-make/save-analysis/sugar.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

fn main() {
let _ = foo();

for x in vec![1, 2, 3, 4] {
println!("{}", x);
}

while let Some(x) = Some(1) {
println!("{}", x);
}
}

fn foo() -> Result<(), ()> {
bar()?;
Ok(())
}

fn bar() -> Result<(), ()> {
Ok(())
}

0 comments on commit 2d17aff

Please sign in to comment.