summaryrefslogtreecommitdiffstats
path: root/src/test/ui/expr/if/attrs/gate-whole-expr.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/expr/if/attrs/gate-whole-expr.rs')
-rw-r--r--src/test/ui/expr/if/attrs/gate-whole-expr.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/ui/expr/if/attrs/gate-whole-expr.rs b/src/test/ui/expr/if/attrs/gate-whole-expr.rs
new file mode 100644
index 000000000..63772d54b
--- /dev/null
+++ b/src/test/ui/expr/if/attrs/gate-whole-expr.rs
@@ -0,0 +1,15 @@
+// run-pass
+
+fn main() {
+ let x = 1;
+
+ #[cfg(FALSE)]
+ if false {
+ x = 2;
+ } else if true {
+ x = 3;
+ } else {
+ x = 4;
+ }
+ assert_eq!(x, 1);
+}