1 ; RUN: llvm-as %s -o - | llvm-dis - | FileCheck %s -check-prefixes CHECK,PROG-AS0
2 ; RUN: llvm-as -data-layout "P200" %s -o - | llvm-dis | FileCheck %s -check-prefixes CHECK,PROG-AS200
3 ; RUN: not llvm-as -data-layout "P123456789" %s -o /dev/null 2>&1 | FileCheck %s -check-prefix BAD-DATALAYOUT
4 ; BAD-DATALAYOUT: LLVM ERROR: Invalid address space, must be a 24-bit integer
6 ; PROG-AS0-NOT: target datalayout
7 ; PROG-AS200: target datalayout = "P200"
9 ; Check that a function declaration without an address space (i.e. AS0) does not
10 ; have the addrspace() attribute printed if it is address space zero and it is
11 ; equal to the program address space.
13 ; PROG-AS0: define void @no_as() {
14 ; PROG-AS200: define void @no_as() addrspace(200) {
15 define void @no_as() {
19 ; A function with an explicit addrspace should only have the addrspace printed
20 ; if it is non-zero or if the module has a nonzero datalayout
21 ; PROG-AS0: define void @explit_as0() {
22 ; PROG-AS200: define void @explit_as0() addrspace(0) {
23 define void @explit_as0() addrspace(0) {
27 ; CHECK: define void @explit_as200() addrspace(200) {
28 define void @explit_as200() addrspace(200) {
32 ; CHECK: define void @explicit_as3() addrspace(3) {
33 define void @explicit_as3() addrspace(3) {