summaryrefslogtreecommitdiffstats
path: root/tests/run-make/link-cfg/with-deps.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run-make/link-cfg/with-deps.rs')
-rw-r--r--tests/run-make/link-cfg/with-deps.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/run-make/link-cfg/with-deps.rs b/tests/run-make/link-cfg/with-deps.rs
new file mode 100644
index 000000000..48b782815
--- /dev/null
+++ b/tests/run-make/link-cfg/with-deps.rs
@@ -0,0 +1,14 @@
+extern crate dep;
+
+fn main() {
+ unsafe {
+ let v = dep::my_function();
+ if cfg!(foo) {
+ assert_eq!(v, 1);
+ } else if cfg!(bar) {
+ assert_eq!(v, 2);
+ } else {
+ panic!("unknown");
+ }
+ }
+}