]> git.lizzy.rs Git - rust.git/commitdiff
Add a test that bare functions are word-sized
authorBrian Anderson <banderson@mozilla.com>
Tue, 11 Oct 2011 01:11:09 +0000 (18:11 -0700)
committerBrian Anderson <banderson@mozilla.com>
Tue, 11 Oct 2011 20:40:28 +0000 (13:40 -0700)
Issue #1022

src/test/run-pass/fn-bare-size.rs [new file with mode: 0644]

diff --git a/src/test/run-pass/fn-bare-size.rs b/src/test/run-pass/fn-bare-size.rs
new file mode 100644 (file)
index 0000000..2a70ff5
--- /dev/null
@@ -0,0 +1,9 @@
+// xfail-test
+
+use std;
+
+fn main() {
+    // Bare functions should just be a pointer
+    assert std::sys::rustrt::size_of::<fn#()>() ==
+        std::sys::rustrt::size_of::<int>();
+}
\ No newline at end of file