about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2011-10-10 18:11:09 -0700
committerBrian Anderson <banderson@mozilla.com>2011-10-11 13:40:28 -0700
commitb04f84275a8f6229ffeeb046251dafa7cf309c6f (patch)
tree178d83b11e3424a7b41a6f20aadd984416f92a40
parent90c240208985aff48c8bf09574c0cb1d79868593 (diff)
downloadrust-b04f84275a8f6229ffeeb046251dafa7cf309c6f.tar.gz
rust-b04f84275a8f6229ffeeb046251dafa7cf309c6f.zip
Add a test that bare functions are word-sized
Issue #1022
-rw-r--r--src/test/run-pass/fn-bare-size.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/run-pass/fn-bare-size.rs b/src/test/run-pass/fn-bare-size.rs
new file mode 100644
index 00000000000..2a70ff55373
--- /dev/null
+++ b/src/test/run-pass/fn-bare-size.rs
@@ -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