Skip to content

Commit

Permalink
Add pub to all the codegen tests
Browse files Browse the repository at this point in the history
Otherwise the test function is internalized and LLVM will most likely optimize
it out.
  • Loading branch information
alexcrichton committed Oct 10, 2013
1 parent b0f6c29 commit caf7b67
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/test/codegen/iterate-over-array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
2 changes: 1 addition & 1 deletion src/test/codegen/scalar-function-call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ fn foo(x: int) -> int {
}

#[no_mangle]
fn test() {
pub fn test() {
let _x = foo(10);
}
2 changes: 1 addition & 1 deletion src/test/codegen/single-return-value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
// except according to those terms.

#[no_mangle]
fn test() -> int {
pub fn test() -> int {
5
}
2 changes: 1 addition & 1 deletion src/test/codegen/small-dense-int-switch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/test/codegen/stack-alloc-string-slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
// except according to those terms.

#[no_mangle]
fn test() {
pub fn test() {
let _x = "hello";
}
10 changes: 5 additions & 5 deletions src/test/codegen/static-method-call-multi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)))))
}
2 changes: 1 addition & 1 deletion src/test/codegen/static-method-call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ impl Struct {
}

#[no_mangle]
fn test(s: &Struct) -> int {
pub fn test(s: &Struct) -> int {
s.method()
}
2 changes: 1 addition & 1 deletion src/test/codegen/virtual-method-call-struct-return.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ trait Trait {
}

#[no_mangle]
fn test(t: &Trait) -> int {
pub fn test(t: &Trait) -> int {
t.method().a
}
2 changes: 1 addition & 1 deletion src/test/codegen/virtual-method-call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ trait Trait {
}

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

5 comments on commit caf7b67

@bors
Copy link
Contributor

@bors bors commented on caf7b67 Oct 10, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from catamorphism
at alexcrichton@caf7b67

@bors
Copy link
Contributor

@bors bors commented on caf7b67 Oct 10, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging alexcrichton/rust/reachable = caf7b67 into auto

@bors
Copy link
Contributor

@bors bors commented on caf7b67 Oct 10, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alexcrichton/rust/reachable = caf7b67 merged ok, testing candidate = 8015f9c

@bors
Copy link
Contributor

@bors bors commented on caf7b67 Oct 10, 2013

@bors
Copy link
Contributor

@bors bors commented on caf7b67 Oct 10, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 8015f9c

Please sign in to comment.