Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
STDOUT is not defined by libc. The correct name is stdout. This
previously worked as STDOUT was incorrectly defined as null pointer
during codegen.
  • Loading branch information
bjorn3 committed Jan 25, 2022
1 parent 1d17c11 commit 2432ba0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions tests/run/assign.rs
Expand Up @@ -51,7 +51,7 @@ mod libc {
pub fn fflush(stream: *mut i32) -> i32;
pub fn printf(format: *const i8, ...) -> i32;

pub static STDOUT: *mut i32;
pub static stdout: *mut i32;
}
}

Expand All @@ -67,7 +67,7 @@ mod intrinsics {
pub fn panic(_msg: &str) -> ! {
unsafe {
libc::puts("Panicking\0" as *const str as *const u8);
libc::fflush(libc::STDOUT);
libc::fflush(libc::stdout);
intrinsics::abort();
}
}
Expand Down
4 changes: 2 additions & 2 deletions tests/run/int_overflow.rs
Expand Up @@ -49,7 +49,7 @@ mod libc {
pub fn puts(s: *const u8) -> i32;
pub fn fflush(stream: *mut i32) -> i32;

pub static STDOUT: *mut i32;
pub static stdout: *mut i32;
}
}

Expand All @@ -65,7 +65,7 @@ mod intrinsics {
pub fn panic(_msg: &str) -> ! {
unsafe {
libc::puts("Panicking\0" as *const str as *const u8);
libc::fflush(libc::STDOUT);
libc::fflush(libc::stdout);
intrinsics::abort();
}
}
Expand Down
4 changes: 2 additions & 2 deletions tests/run/mut_ref.rs
Expand Up @@ -53,7 +53,7 @@ mod libc {
pub fn fflush(stream: *mut i32) -> i32;
pub fn printf(format: *const i8, ...) -> i32;

pub static STDOUT: *mut i32;
pub static stdout: *mut i32;
}
}

Expand All @@ -69,7 +69,7 @@ mod intrinsics {
pub fn panic(_msg: &str) -> ! {
unsafe {
libc::puts("Panicking\0" as *const str as *const u8);
libc::fflush(libc::STDOUT);
libc::fflush(libc::stdout);
intrinsics::abort();
}
}
Expand Down
4 changes: 2 additions & 2 deletions tests/run/operations.rs
Expand Up @@ -59,7 +59,7 @@ mod libc {
pub fn puts(s: *const u8) -> i32;
pub fn fflush(stream: *mut i32) -> i32;

pub static STDOUT: *mut i32;
pub static stdout: *mut i32;
}
}

Expand All @@ -75,7 +75,7 @@ mod intrinsics {
pub fn panic(_msg: &str) -> ! {
unsafe {
libc::puts("Panicking\0" as *const str as *const u8);
libc::fflush(libc::STDOUT);
libc::fflush(libc::stdout);
intrinsics::abort();
}
}
Expand Down

0 comments on commit 2432ba0

Please sign in to comment.