36 lines · plain
1; RUN: llvm-as %s -o - | llvm-dis - | FileCheck %s -check-prefixes CHECK,PROG-AS02; RUN: llvm-as -data-layout "P200" %s -o - | llvm-dis | FileCheck %s -check-prefixes CHECK,PROG-AS2003; RUN: not llvm-as -data-layout "P123456789" %s -o /dev/null 2>&1 | FileCheck %s -check-prefix BAD-DATALAYOUT4; BAD-DATALAYOUT: error: address space must be a 24-bit integer5 6; PROG-AS0-NOT: target datalayout7; PROG-AS200: target datalayout = "P200"8 9; Check that a function declaration without an address space (i.e. AS0) does not10; have the addrspace() attribute printed if it is address space zero and it is11; equal to the program address space.12 13; PROG-AS0: define void @no_as() {14; PROG-AS200: define void @no_as() addrspace(200) {15define void @no_as() {16 ret void17}18 19; A function with an explicit addrspace should only have the addrspace printed20; if it is non-zero or if the module has a nonzero datalayout21; PROG-AS0: define void @explit_as0() {22; PROG-AS200: define void @explit_as0() addrspace(0) {23define void @explit_as0() addrspace(0) {24 ret void25}26 27; CHECK: define void @explit_as200() addrspace(200) {28define void @explit_as200() addrspace(200) {29 ret void30}31 32; CHECK: define void @explicit_as3() addrspace(3) {33define void @explicit_as3() addrspace(3) {34 ret void35}36