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:
parent
b0f6c29b4f
commit
caf7b678dd
9 changed files with 13 additions and 13 deletions
|
|
@ -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()) {
|
||||
|
|
|
|||
|
|
@ -13,6 +13,6 @@ fn foo(x: int) -> int {
|
|||
}
|
||||
|
||||
#[no_mangle]
|
||||
fn test() {
|
||||
pub fn test() {
|
||||
let _x = foo(10);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,6 @@
|
|||
// except according to those terms.
|
||||
|
||||
#[no_mangle]
|
||||
fn test() -> int {
|
||||
pub fn test() -> int {
|
||||
5
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -9,6 +9,6 @@
|
|||
// except according to those terms.
|
||||
|
||||
#[no_mangle]
|
||||
fn test() {
|
||||
pub fn test() {
|
||||
let _x = "hello";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)))))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,6 @@ impl Struct {
|
|||
}
|
||||
|
||||
#[no_mangle]
|
||||
fn test(s: &Struct) -> int {
|
||||
pub fn test(s: &Struct) -> int {
|
||||
s.method()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,6 @@ trait Trait {
|
|||
}
|
||||
|
||||
#[no_mangle]
|
||||
fn test(t: &Trait) -> int {
|
||||
pub fn test(t: &Trait) -> int {
|
||||
t.method().a
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,6 @@ trait Trait {
|
|||
}
|
||||
|
||||
#[no_mangle]
|
||||
fn test(t: &Trait) -> int {
|
||||
pub fn test(t: &Trait) -> int {
|
||||
t.method()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue