Skip to content

Commit caf7b67

Browse files
committed
Add pub to all the codegen tests
Otherwise the test function is internalized and LLVM will most likely optimize it out.
1 parent b0f6c29 commit caf7b67

9 files changed

+13
-13
lines changed

src/test/codegen/iterate-over-array.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
#[no_mangle]
12-
fn test(x: &[int]) -> int {
12+
pub fn test(x: &[int]) -> int {
1313
let mut y = 0;
1414
let mut i = 0;
1515
while (i < x.len()) {

src/test/codegen/scalar-function-call.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ fn foo(x: int) -> int {
1313
}
1414

1515
#[no_mangle]
16-
fn test() {
16+
pub fn test() {
1717
let _x = foo(10);
1818
}

src/test/codegen/single-return-value.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
// except according to those terms.
1010

1111
#[no_mangle]
12-
fn test() -> int {
12+
pub fn test() -> int {
1313
5
1414
}

src/test/codegen/small-dense-int-switch.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
#[no_mangle]
12-
fn test(x: int, y: int) -> int {
12+
pub fn test(x: int, y: int) -> int {
1313
match x {
1414
1 => y,
1515
2 => y*2,

src/test/codegen/stack-alloc-string-slice.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
// except according to those terms.
1010

1111
#[no_mangle]
12-
fn test() {
12+
pub fn test() {
1313
let _x = "hello";
1414
}

src/test/codegen/static-method-call-multi.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ impl Struct {
1919
}
2020

2121
#[no_mangle]
22-
fn test(a: &Struct,
23-
b: &Struct,
24-
c: &Struct,
25-
d: &Struct,
26-
e: &Struct) -> int {
22+
pub fn test(a: &Struct,
23+
b: &Struct,
24+
c: &Struct,
25+
d: &Struct,
26+
e: &Struct) -> int {
2727
a.method(b.method(c.method(d.method(e.method(1)))))
2828
}

src/test/codegen/static-method-call.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ impl Struct {
1919
}
2020

2121
#[no_mangle]
22-
fn test(s: &Struct) -> int {
22+
pub fn test(s: &Struct) -> int {
2323
s.method()
2424
}

src/test/codegen/virtual-method-call-struct-return.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ trait Trait {
1818
}
1919

2020
#[no_mangle]
21-
fn test(t: &Trait) -> int {
21+
pub fn test(t: &Trait) -> int {
2222
t.method().a
2323
}

src/test/codegen/virtual-method-call.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ trait Trait {
1313
}
1414

1515
#[no_mangle]
16-
fn test(t: &Trait) -> int {
16+
pub fn test(t: &Trait) -> int {
1717
t.method()
1818
}

0 commit comments

Comments
 (0)