2009-11-08 09:45:36 +08:00
|
|
|
// RUN: clang-cc -emit-llvm < %s | grep '@foo.*global.*addrspace(1)'
|
|
|
|
// RUN: clang-cc -emit-llvm < %s | grep '@ban.*global.*addrspace(1)'
|
|
|
|
// RUN: clang-cc -emit-llvm < %s | grep 'load.*addrspace(1)' | count 2
|
|
|
|
// RUN: clang-cc -emit-llvm < %s | grep 'load.*addrspace(2).. @A'
|
2009-03-24 10:24:46 +08:00
|
|
|
// RUN: clang-cc -emit-llvm < %s | grep 'load.*addrspace(2).. @B'
|
2008-06-26 14:27:57 +08:00
|
|
|
|
2008-02-04 10:31:56 +08:00
|
|
|
int foo __attribute__((address_space(1)));
|
|
|
|
int ban[10] __attribute__((address_space(1)));
|
|
|
|
|
|
|
|
int bar() { return foo; }
|
|
|
|
|
2008-02-04 10:35:11 +08:00
|
|
|
int baz(int i) { return ban[i]; }
|
2008-06-26 14:27:57 +08:00
|
|
|
|
|
|
|
// Both A and B point into addrspace(2).
|
|
|
|
__attribute__((address_space(2))) int *A, *B;
|
|
|
|
|
|
|
|
void test3() {
|
|
|
|
*A = *B;
|
|
|
|
}
|
|
|
|
|