Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
7bdf705
Avoid ICE when is_val_statically_known is not of a supported type
Teapot4195 Jan 30, 2024
a97ff2a
Add additional test cases for is_val_statically_known
Teapot4195 Jan 30, 2024
15b4734
Remove unused `Constructor: PartialEq` impl
Nadrieril Jan 30, 2024
40402cb
Manual `Debug` impls are not needed since `TypeCx: Debug`
Nadrieril Jan 31, 2024
ee2cddd
It is correct to lower `!` to `_`.
Nadrieril Jan 31, 2024
a158fb3
Improve `io::Read::read_buf_exact` error case
a1phyr Jan 31, 2024
7ea4dbb
Store SHOULD_CAPTURE as AtomicU8
GnomedDev Jan 31, 2024
8eb48b4
Update data layouts in custom target tests for LLVM 18
nikic Jan 31, 2024
f7531f1
Remove has_errors check that has no effect
oli-obk Jan 31, 2024
a6b1e43
Remove a has_errors check that only hides errors after unrelated item…
oli-obk Jan 31, 2024
28f250d
Remove a has_errors check that does not prevent follow up error noise
oli-obk Jan 31, 2024
d31905c
Remove a has_errors check that doesn't actually prevent noisy follow …
oli-obk Jan 31, 2024
647a453
Correct paths for hexagon-unknown-none-elf platform doc
androm3da Jan 31, 2024
6f24836
Rollup merge of #120484 - Teapot4195:issue-120480-fix, r=compiler-errors
matthiaskrgr Feb 3, 2024
f3ebf1e
Rollup merge of #120516 - Nadrieril:cleanup-impls, r=compiler-errors
matthiaskrgr Feb 3, 2024
ceeaa8a
Rollup merge of #120517 - Nadrieril:lower-never-as-wildcard, r=compil…
matthiaskrgr Feb 3, 2024
a3ea647
Rollup merge of #120523 - a1phyr:improve_read_buf_exact, r=the8472
matthiaskrgr Feb 3, 2024
3e24351
Rollup merge of #120528 - GnomedDev:atomicu8-backtrace-style, r=cuviper
matthiaskrgr Feb 3, 2024
6992078
Rollup merge of #120529 - nikic:llvm-18-datalayout-fixes, r=cuviper
matthiaskrgr Feb 3, 2024
7d516c5
Rollup merge of #120531 - oli-obk:track_errors7, r=estebank
matthiaskrgr Feb 3, 2024
edd2494
Rollup merge of #120533 - androm3da:bcain/update_hex_docs, r=wesleywiser
matthiaskrgr Feb 3, 2024
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add additional test cases for is_val_statically_known
  • Loading branch information
Teapot4195 committed Jan 30, 2024
commit a97ff2a750edf9ba4a9cdfd72f419f6836fe6b2d
38 changes: 38 additions & 0 deletions tests/codegen/is_val_statically_known.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,41 @@ pub fn _bool_false(b: bool) -> i32 {
// CHECK: ret i32 2
_bool(b)
}

#[inline]
pub fn _iref(a: &u8) -> i32 {
if unsafe { is_val_statically_known(a) } { 5 } else { 4 }
}

// CHECK-LABEL: @_iref_borrow(
#[no_mangle]
pub fn _iref_borrow() -> i32 {
// CHECK: ret i32 4
_iref(&0)
}

// CHECK-LABEL: @_iref_arg(
#[no_mangle]
pub fn _iref_arg(a: &u8) -> i32 {
// CHECK: ret i32 4
_iref(a)
}

#[inline]
pub fn _slice_ref(a: &[u8]) -> i32 {
if unsafe { is_val_statically_known(a) } { 7 } else { 6 }
}

// CHECK-LABEL: @_slice_ref_borrow(
#[no_mangle]
pub fn _slice_ref_borrow() -> i32 {
// CHECK: ret i32 6
_slice_ref(&[0;3])
}

// CHECK-LABEL: @_slice_ref_arg(
#[no_mangle]
pub fn _slice_ref_arg(a: &[u8]) -> i32 {
// CHECK: ret i32 6
_slice_ref(a)
}