blob: 5b5891955714818a025eb782e0b666e178727121 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -emit-llvm < %s | grep '@foo.*global.*addrspace(1)'
2// RUN: %clang_cc1 -emit-llvm < %s | grep '@ban.*global.*addrspace(1)'
3// RUN: %clang_cc1 -emit-llvm < %s | grep 'load.*addrspace(1)' | count 2
4// RUN: %clang_cc1 -emit-llvm < %s | grep 'load.*addrspace(2).. @A'
5// RUN: %clang_cc1 -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