1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00
llvm-mirror/test/Assembler/call-nonzero-program-addrspace-2.ll
Alexander Richardson 499baa0abb Make the LLParser accept call instructions of variables in the program AS
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
2018-02-27 11:15:11 +00:00

12 lines
522 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 numbered variables in a nonzero program address space 200 can be used in a call instruction
define i8 @test_unnamed(i8(i32)*, i8(i32) addrspace(200)*) {
%first = call i8 %0(i32 0) ; this is fine
%second = call i8 %1(i32 0) ; this is also fine if it's the program AS
; CHECK: call-nonzero-program-addrspace-2.ll:[[@LINE-1]]:21: error: '%1' defined with type 'i8 (i32) addrspace(200)*'
ret i8 0
}