Add "run-make" test for trace-macros flag
This commit is contained in:
parent
d14109ec7e
commit
bed2d33523
3 changed files with 24 additions and 0 deletions
9
src/test/run-make/trace-macros-flag/Makefile
Normal file
9
src/test/run-make/trace-macros-flag/Makefile
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
# This test verifies that "-Z trace-macros" works as it should. The traditional
|
||||
# "hello world" program provides a small example of this as not only println! is
|
||||
# listed, but also print! (since println! expands to this)
|
||||
|
||||
-include ../tools.mk
|
||||
|
||||
all:
|
||||
$(RUSTC) -o $(TMPDIR)/hello -Z trace-macros hello.rs &> $(TMPDIR)/hello.trace
|
||||
diff -u $(TMPDIR)/hello.trace hello.trace
|
||||
13
src/test/run-make/trace-macros-flag/hello.rs
Normal file
13
src/test/run-make/trace-macros-flag/hello.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
// Copyright 2014 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() {
|
||||
println!("Hello, World!");
|
||||
}
|
||||
2
src/test/run-make/trace-macros-flag/hello.trace
Normal file
2
src/test/run-make/trace-macros-flag/hello.trace
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
println! { "Hello, World!" }
|
||||
print! { concat ! ( "Hello, World!" , "\n" ) }
|
||||
Loading…
Add table
Add a link
Reference in a new issue