• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llvm-as %s -data-layout=P200 -o /dev/null
2; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
3
4; Check that variables in a nonzero program address space 200 can be used in a invoke instruction
5
6define i8 @test_invoke(i8(i32)* %fnptr0, i8(i32) addrspace(200)* %fnptr200) personality i32 (...)* @__gxx_personality_v0 {
7  %first = invoke i8 %fnptr0(i32 0) to label %ok unwind label %lpad ; this is fine
8  %second = invoke i8 %fnptr200(i32 0) to label %ok unwind label %lpad ; this is also fine if it's the program AS
9  ; CHECK: invoke-nonzero-program-addrspace.ll:[[@LINE-1]]:23: error: '%fnptr200' defined with type 'i8 (i32) addrspace(200)*'
10ok:
11  ret i8 0
12lpad:
13    %exn = landingpad {i8*, i32}
14            cleanup
15    unreachable
16}
17
18declare i32 @__gxx_personality_v0(...)
19