about summary refs log tree commit diff
path: root/src/test/codegen-units
diff options
context:
space:
mode:
authorJames Miller <james@aatch.net>2016-05-10 10:14:41 +1200
committerMichael Woerister <michaelwoerister@posteo.net>2016-05-11 13:59:14 -0400
commitf4dd4be86a9d8310608ee1ae84d33854cce52825 (patch)
treec30c43ae819b9776fdc4ffb6b436ced0eaafbddd /src/test/codegen-units
parentdace30659f286206c633fcaaf45d9aa02386a3ac (diff)
downloadrust-f4dd4be86a9d8310608ee1ae84d33854cce52825.tar.gz
rust-f4dd4be86a9d8310608ee1ae84d33854cce52825.zip
Add test for collecting items in statics
Diffstat (limited to 'src/test/codegen-units')
-rw-r--r--src/test/codegen-units/item-collection/static-init.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/codegen-units/item-collection/static-init.rs b/src/test/codegen-units/item-collection/static-init.rs
new file mode 100644
index 00000000000..41c0f46f80b
--- /dev/null
+++ b/src/test/codegen-units/item-collection/static-init.rs
@@ -0,0 +1,23 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// compile-flags:-Zprint-trans-items=eager
+
+pub static FN : fn() = foo::<i32>;
+
+pub fn foo<T>() { }
+
+//~ TRANS_ITEM fn static_init::foo[0]<i32>
+//~ TRANS_ITEM static static_init::FN[0]
+
+fn main() { }
+
+//~ TRANS_ITEM fn static_init::main[0]
+//~ TRANS_ITEM drop-glue i8