summaryrefslogtreecommitdiffstats
path: root/src/test/ui/cross-crate/const-cross-crate-const.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/cross-crate/const-cross-crate-const.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/ui/cross-crate/const-cross-crate-const.rs b/src/test/ui/cross-crate/const-cross-crate-const.rs
new file mode 100644
index 000000000..92020417f
--- /dev/null
+++ b/src/test/ui/cross-crate/const-cross-crate-const.rs
@@ -0,0 +1,16 @@
+// run-pass
+// aux-build:cci_const.rs
+#![allow(non_upper_case_globals)]
+
+extern crate cci_const;
+static foo: &'static str = cci_const::foopy;
+static a: usize = cci_const::uint_val;
+static b: usize = cci_const::uint_expr + 5;
+
+pub fn main() {
+ assert_eq!(a, 12);
+ let foo2 = a;
+ assert_eq!(foo2, cci_const::uint_val);
+ assert_eq!(b, cci_const::uint_expr + 5);
+ assert_eq!(foo, cci_const::foopy);
+}