blob: 8536f161533beedfe7b427d3cfbe5e0f332b330e [file] [log] [blame]
Daniel Dunbar4fcfde42009-11-08 01:45:36 +00001// RUN: clang-cc -emit-llvm < %s | grep '@foo.*global.*addrspace(1)'
2// RUN: clang-cc -emit-llvm < %s | grep '@ban.*global.*addrspace(1)'
3// RUN: clang-cc -emit-llvm < %s | grep 'load.*addrspace(1)' | count 2
4// RUN: clang-cc -emit-llvm < %s | grep 'load.*addrspace(2).. @A'
Daniel Dunbard7d5f022009-03-24 02:24:46 +00005// RUN: clang-cc -emit-llvm < %s | grep 'load.*addrspace(2).. @B'
Chris Lattnerfca0ddd2008-06-26 06:27:57 +00006
Christopher Lambebb97e92008-02-04 02:31:56 +00007int foo __attribute__((address_space(1)));
8int ban[10] __attribute__((address_space(1)));
9
10int bar() { return foo; }
11
Christopher Lambb41a7d22008-02-04 02:35:11 +000012int baz(int i) { return ban[i]; }
Chris Lattnerfca0ddd2008-06-26 06:27:57 +000013
14// Both A and B point into addrspace(2).
15__attribute__((address_space(2))) int *A, *B;
16
17void test3() {
18 *A = *B;
19}
20