summaryrefslogtreecommitdiffstats
path: root/tests/run-make/static-extern-type/use-foo.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run-make/static-extern-type/use-foo.rs')
-rw-r--r--tests/run-make/static-extern-type/use-foo.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/run-make/static-extern-type/use-foo.rs b/tests/run-make/static-extern-type/use-foo.rs
new file mode 100644
index 000000000..932b5b594
--- /dev/null
+++ b/tests/run-make/static-extern-type/use-foo.rs
@@ -0,0 +1,14 @@
+#![feature(extern_types)]
+
+extern "C" {
+ type Foo;
+ static FOO: Foo;
+ fn bar(foo: *const Foo) -> u8;
+}
+
+fn main() {
+ unsafe {
+ let foo = &FOO;
+ assert_eq!(bar(foo), 42);
+ }
+}