-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Nikita Popov <github@npopov.com>
- Loading branch information
Showing
11 changed files
with
33 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,26 @@ | ||
//@ compile-flags: -O | ||
// XXX: The x86-64 assembly get optimized correclty. But llvm-ir output is not until llvm 18? | ||
//@ min-llvm-version: 18 | ||
|
||
#![crate_type = "lib"] | ||
|
||
pub enum K{ | ||
pub enum K { | ||
A(Box<[i32]>), | ||
B(Box<[u8]>), | ||
C(Box<[String]>), | ||
D(Box<[u16]>), | ||
} | ||
|
||
#[no_mangle] | ||
// CHECK-LABEL: @get_len | ||
// CHECK: getelementptr inbounds | ||
// CHECK-NEXT: {{.*}}: | ||
// CHECK-NEXT: getelementptr inbounds | ||
// CHECK-NEXT: load | ||
// CHECK-NEXT: ret i64 | ||
// CHECK-NOT: switch | ||
pub fn get_len(arg: &K)->usize{ | ||
#[no_mangle] | ||
pub fn get_len(arg: &K) -> usize { | ||
match arg { | ||
K::A(ref lst)=>lst.len(), | ||
K::B(ref lst)=>lst.len(), | ||
K::C(ref lst)=>lst.len(), | ||
K::D(ref lst)=>lst.len(), | ||
K::A(ref lst) => lst.len(), | ||
K::B(ref lst) => lst.len(), | ||
K::C(ref lst) => lst.len(), | ||
K::D(ref lst) => lst.len(), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
tests/codegen/issues/issue-113757-bounds-check-after-cmp-max.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters