]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/proc_macro.rs
Rollup merge of #60685 - dtolnay:spdx, r=nikomatsakis
[rust.git] / src / test / run-pass / proc_macro.rs
1 // aux-build:proc_macro_def.rs
2 // ignore-cross-compile
3
4 #![feature(proc_macro_hygiene)]
5
6 extern crate proc_macro_def;
7
8 use proc_macro_def::{attr_tru, attr_identity, identity, ret_tru, tru};
9
10 #[attr_tru]
11 fn f1() -> bool {
12     return false;
13 }
14
15 #[attr_identity]
16 fn f2() -> bool {
17     return identity!(true);
18 }
19
20 fn f3() -> identity!(bool) {
21     ret_tru!();
22 }
23
24 fn f4(x: bool) -> bool {
25     match x {
26         identity!(true) => false,
27         identity!(false) => true,
28     }
29 }
30
31 fn main() {
32     assert!(f1());
33     assert!(f2());
34     assert!(tru!());
35     assert!(f3());
36     assert!(identity!(5 == 5));
37     assert!(f4(false));
38 }