Add pub to all the codegen tests

Otherwise the test function is internalized and LLVM will most likely optimize
it out.
This commit is contained in:
Alex Crichton 2013-10-10 06:00:51 -07:00
parent b0f6c29b4f
commit caf7b678dd
9 changed files with 13 additions and 13 deletions

View file

@ -9,7 +9,7 @@
// except according to those terms.
#[no_mangle]
fn test(x: &[int]) -> int {
pub fn test(x: &[int]) -> int {
let mut y = 0;
let mut i = 0;
while (i < x.len()) {

View file

@ -13,6 +13,6 @@ fn foo(x: int) -> int {
}
#[no_mangle]
fn test() {
pub fn test() {
let _x = foo(10);
}

View file

@ -9,6 +9,6 @@
// except according to those terms.
#[no_mangle]
fn test() -> int {
pub fn test() -> int {
5
}

View file

@ -9,7 +9,7 @@
// except according to those terms.
#[no_mangle]
fn test(x: int, y: int) -> int {
pub fn test(x: int, y: int) -> int {
match x {
1 => y,
2 => y*2,

View file

@ -9,6 +9,6 @@
// except according to those terms.
#[no_mangle]
fn test() {
pub fn test() {
let _x = "hello";
}

View file

@ -19,10 +19,10 @@ impl Struct {
}
#[no_mangle]
fn test(a: &Struct,
b: &Struct,
c: &Struct,
d: &Struct,
e: &Struct) -> int {
pub fn test(a: &Struct,
b: &Struct,
c: &Struct,
d: &Struct,
e: &Struct) -> int {
a.method(b.method(c.method(d.method(e.method(1)))))
}

View file

@ -19,6 +19,6 @@ impl Struct {
}
#[no_mangle]
fn test(s: &Struct) -> int {
pub fn test(s: &Struct) -> int {
s.method()
}

View file

@ -18,6 +18,6 @@ trait Trait {
}
#[no_mangle]
fn test(t: &Trait) -> int {
pub fn test(t: &Trait) -> int {
t.method().a
}

View file

@ -13,6 +13,6 @@ trait Trait {
}
#[no_mangle]
fn test(t: &Trait) -> int {
pub fn test(t: &Trait) -> int {
t.method()
}