mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
499baa0abb
Summary: Since r325479 the DataLayout includes a program address space. However, it is not possible to use `call %foo` if foo is a `i8(...) addrspace(200)` and the DataLayout specifies address space 200 as the address space for functions. With this change the IR parser will still accept variables in the program address space as well as address space 0 for call and invoke functions. Reviewers: pcc, arsenm, bjope, dylanmckay, theraven Reviewed By: dylanmckay Subscribers: wdng, llvm-commits Differential Revision: https://reviews.llvm.org/D43645 llvm-svn: 326188
19 lines
783 B
LLVM
19 lines
783 B
LLVM
; RUN: llvm-as %s -data-layout=P200 -o /dev/null
|
|
; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
|
|
|
|
; Check that variables in a nonzero program address space 200 can be used in a invoke instruction
|
|
|
|
define i8 @test_invoke(i8(i32)* %fnptr0, i8(i32) addrspace(200)* %fnptr200) personality i32 (...)* @__gxx_personality_v0 {
|
|
%first = invoke i8 %fnptr0(i32 0) to label %ok unwind label %lpad ; this is fine
|
|
%second = invoke i8 %fnptr200(i32 0) to label %ok unwind label %lpad ; this is also fine if it's the program AS
|
|
; CHECK: invoke-nonzero-program-addrspace.ll:[[@LINE-1]]:23: error: '%fnptr200' defined with type 'i8 (i32) addrspace(200)*'
|
|
ok:
|
|
ret i8 0
|
|
lpad:
|
|
%exn = landingpad {i8*, i32}
|
|
cleanup
|
|
unreachable
|
|
}
|
|
|
|
declare i32 @__gxx_personality_v0(...)
|