Files
rk35xx-android14/external/clang/test/CodeGenCXX/address-space-ref.cpp
T
hmz007 36ed224bac Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a)
Signed-off-by: hmz007 <hmz007@gmail.com>
Change-Id: Ib87fdbe7a0be7dc961af3500fe9ea4589a127f9f
2024-10-29 18:12:02 +08:00

35 lines
994 B
C++

// RUN: %clang_cc1 %s -std=c++11 -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s
// For a reference to a complete type, output the dereferenceable attribute (in
// any address space).
typedef int a __attribute__((address_space(1)));
a & foo(a &x, a & y) {
return x;
}
// CHECK: define dereferenceable(4) i32 addrspace(1)* @_Z3fooRU3AS1iS0_(i32 addrspace(1)* dereferenceable(4) %x, i32 addrspace(1)* dereferenceable(4) %y)
// For a reference to an incomplete type in an alternate address space, output
// neither dereferenceable nor nonnull.
class bc;
typedef bc b __attribute__((address_space(1)));
b & bar(b &x, b & y) {
return x;
}
// CHECK: define %class.bc addrspace(1)* @_Z3barRU3AS12bcS1_(%class.bc addrspace(1)* %x, %class.bc addrspace(1)* %y)
// For a reference to an incomplete type in addrspace(0), output nonnull.
bc & bar2(bc &x, bc & y) {
return x;
}
// CHECK: define nonnull %class.bc* @_Z4bar2R2bcS0_(%class.bc* nonnull %x, %class.bc* nonnull %y)