Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions c2rust-transpile/tests/snapshots/out_of_range_int.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <stdint.h>

void f() {
int32_t a = 0x80000000U;
int32_t b = 0x80000000;
int32_t c = 0x8000000000000000;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
source: c2rust-transpile/tests/snapshots.rs
expression: cat tests/snapshots/out_of_range_int.rs
input_file: c2rust-transpile/tests/snapshots/out_of_range_int.c
---
#![allow(
dead_code,
mutable_transmutes,
non_camel_case_types,
non_snake_case,
non_upper_case_globals,
unused_assignments,
unused_mut
)]
pub type __int32_t = std::ffi::c_int;
pub type int32_t = __int32_t;
#[no_mangle]
pub unsafe extern "C" fn f() {
let mut a: int32_t = 0x80000000 as std::ffi::c_uint as int32_t;
let mut b: int32_t = 0x80000000 as std::ffi::c_uint as int32_t;
let mut c: int32_t = 0x8000000000000000 as std::ffi::c_ulong as int32_t;
}
Loading