summaryrefslogtreecommitdiffstats
path: root/src/test/ui/codegen/issue-16602-3.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/codegen/issue-16602-3.rs28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/test/ui/codegen/issue-16602-3.rs b/src/test/ui/codegen/issue-16602-3.rs
new file mode 100644
index 000000000..ca1ab3cc7
--- /dev/null
+++ b/src/test/ui/codegen/issue-16602-3.rs
@@ -0,0 +1,28 @@
+// run-pass
+#![allow(unused_variables)]
+#![allow(unused_assignments)]
+#[derive(Debug)]
+#[allow(unused_tuple_struct_fields)]
+enum Foo {
+ Bar(u32, u32),
+ Baz(&'static u32, &'static u32)
+}
+
+static NUM: u32 = 100;
+
+fn main () {
+ let mut b = Foo::Baz(&NUM, &NUM);
+ b = Foo::Bar(f(&b), g(&b));
+}
+
+static FNUM: u32 = 1;
+
+fn f (b: &Foo) -> u32 {
+ FNUM
+}
+
+static GNUM: u32 = 2;
+
+fn g (b: &Foo) -> u32 {
+ GNUM
+}