parent
14dbac9a8b
commit
9a56a0d10d
|
@ -0,0 +1,27 @@
|
|||
// { dg-additional-options "-w -frust-cfg=A" }
|
||||
// { dg-output "A\n" }
|
||||
macro_rules! cfg {
|
||||
() => {{}};
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
fn printf(fmt: *const i8, ...);
|
||||
}
|
||||
|
||||
fn print(s: &str) {
|
||||
printf("%s\n" as *const str as *const i8, s as *const str as *const i8);
|
||||
}
|
||||
|
||||
|
||||
fn main() -> i32 {
|
||||
let cfg = cfg!(A);
|
||||
if cfg {
|
||||
print("A");
|
||||
}
|
||||
let cfg = cfg!(B);
|
||||
if cfg {
|
||||
print("B");
|
||||
}
|
||||
|
||||
0
|
||||
}
|
Loading…
Reference in New Issue