mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-27 04:18:42 +00:00
Fix the interpreter to not crash due to zeroext/signext
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86428 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
1 parent
36206182e1
commit
dbf6f518e9
2 files changed
+19
-10
No files matched your search
@@ -0,0 +1,19 @@
|
||||
; RUN: lli -force-interpreter
|
||||
; Extending a value due to zeroext/signext will leave it the wrong size
|
||||
; causing problems later, such as a crash if you try to extend it again.
|
||||
|
||||
define void @zero(i8 zeroext %foo) {
|
||||
zext i8 %foo to i32
|
||||
ret void
|
||||
}
|
||||
|
||||
define void @sign(i8 signext %foo) {
|
||||
sext i8 %foo to i32
|
||||
ret void
|
||||
}
|
||||
|
||||
define i32 @main() {
|
||||
call void @zero(i8 0)
|
||||
call void @sign(i8 0)
|
||||
ret i32 0
|
||||
}
|
||||
Reference in new issue
Block a user