mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-03 17:24:24 +00:00
Add a test showing the ppc code sequence for getting a function pointer.
This would have found the miscompile in r209638. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209820 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
843ac4747a
commit
f5df18bff0
21
test/CodeGen/PowerPC/func-addr.ll
Normal file
21
test/CodeGen/PowerPC/func-addr.ll
Normal file
@ -0,0 +1,21 @@
|
||||
; RUN: llc -mtriple powerpc64-linux < %s | FileCheck %s
|
||||
|
||||
define void @foo() {
|
||||
ret void
|
||||
}
|
||||
declare i32 @bar(i8*)
|
||||
|
||||
; CHECK-LABEL: {{^}}zed:
|
||||
; CHECK: addis 3, 2, .LC1@toc@ha
|
||||
; CHECK-NEXT: ld 3, .LC1@toc@l(3)
|
||||
; CHECK-NEXT: bl bar
|
||||
|
||||
|
||||
; CHECK-LABEL: .section .toc,"aw",@progbits
|
||||
; CHECK: .LC1:
|
||||
; CHECK-NEXT: .tc foo[TC],foo
|
||||
|
||||
define void @zed() {
|
||||
call i32 @bar(i8* bitcast (void ()* @foo to i8*))
|
||||
ret void
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user