mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
Implement support for the case when a reference to a addr-of-bb
label is generated, but then the block is deleted. Since the value is undefined, we just emit the label right after the entry label of the function. It might matter that the label is in the same section as the function was afterall. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98579 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
39
test/CodeGen/Generic/addr-label.ll
Normal file
39
test/CodeGen/Generic/addr-label.ll
Normal file
@@ -0,0 +1,39 @@
|
||||
; RUN: llc %s -o -
|
||||
|
||||
;; Reference to a label that gets deleted.
|
||||
define i8* @test1() nounwind {
|
||||
entry:
|
||||
ret i8* blockaddress(@test1b, %test_label)
|
||||
}
|
||||
|
||||
define i32 @test1b() nounwind {
|
||||
entry:
|
||||
ret i32 -1
|
||||
test_label:
|
||||
br label %ret
|
||||
ret:
|
||||
ret i32 -1
|
||||
}
|
||||
|
||||
|
||||
;; Issues with referring to a label that gets RAUW'd later.
|
||||
define i32 @test2a() nounwind {
|
||||
entry:
|
||||
%target = bitcast i8* blockaddress(@test2b, %test_label) to i8*
|
||||
|
||||
call i32 @test2b(i8* %target)
|
||||
|
||||
ret i32 0
|
||||
}
|
||||
|
||||
define i32 @test2b(i8* %target) nounwind {
|
||||
entry:
|
||||
indirectbr i8* %target, [label %test_label]
|
||||
|
||||
test_label:
|
||||
; assume some code here...
|
||||
br label %ret
|
||||
|
||||
ret:
|
||||
ret i32 -1
|
||||
}
|
Reference in New Issue
Block a user