We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 14dbac9 commit 9a56a0dCopy full SHA for 9a56a0d
gcc/testsuite/rust/execute/torture/builtin_macro_cfg.rs
@@ -0,0 +1,27 @@
1
+// { dg-additional-options "-w -frust-cfg=A" }
2
+// { dg-output "A\n" }
3
+macro_rules! cfg {
4
+ () => {{}};
5
+}
6
+
7
+extern "C" {
8
+ fn printf(fmt: *const i8, ...);
9
10
11
+fn print(s: &str) {
12
+ printf("%s\n" as *const str as *const i8, s as *const str as *const i8);
13
14
15
16
+fn main() -> i32 {
17
+ let cfg = cfg!(A);
18
+ if cfg {
19
+ print("A");
20
+ }
21
+ let cfg = cfg!(B);
22
23
+ print("B");
24
25
26
+ 0
27
0 commit comments