Skip to content

Commit

Permalink
rt: Add tests for box annihilator.
Browse files Browse the repository at this point in the history
  • Loading branch information
Elliott Slaughter committed Aug 31, 2012
1 parent f022f56 commit 3b554c1
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/test/run-pass/box-annihilator-shared.rs
@@ -0,0 +1,11 @@
extern mod rustrt {
fn rust_annihilate_box(ptr: *uint);
}

fn main() {
unsafe {
let x = @3;
let p: *uint = unsafe::transmute(x);
rustrt::rust_annihilate_box(p);
}
}
11 changes: 11 additions & 0 deletions src/test/run-pass/box-annihilator-unique-vec.rs
@@ -0,0 +1,11 @@
extern mod rustrt {
fn rust_annihilate_box(ptr: *uint);
}

fn main() {
unsafe {
let x = ~[~"a", ~"b", ~"c"];
let p: *uint = unsafe::transmute(x);
rustrt::rust_annihilate_box(p);
}
}
11 changes: 11 additions & 0 deletions src/test/run-pass/box-annihilator-unique.rs
@@ -0,0 +1,11 @@
extern mod rustrt {
fn rust_annihilate_box(ptr: *uint);
}

fn main() {
unsafe {
let x = ~3;
let p: *uint = unsafe::transmute(x);
rustrt::rust_annihilate_box(p);
}
}

0 comments on commit 3b554c1

Please sign in to comment.