llvm-project/clang/test/CodeGenCXX/mangle-address-space.cpp
John McCall 07daf721fb Mangle extended qualifiers in the proper order and mangle the
ARC ownership-convention function type modifications.

According to the Itanium ABI, vendor extended qualifiers are
supposed to be mangled in reverse-alphabetical order before
any CVR qualifiers.  The ARC function type conventions are
plausibly order-significant (they are associated with the
function type), which permits us to ignore the need to correctly
inter-order them with any other vendor qualifiers on the parameter
and return types.

Implementing these rules correctly is technically an ABI break.
Apple is comfortable with the risk of incompatibility here for
the ARC features, and I believe that address-space qualification
is still uncommon enough to allow us to adopt the conforming
rule without serious risk.  Still, targets which make heavy
use of address space qualification may want to revert to the
non-conforming order.

llvm-svn: 262414
2016-03-01 22:18:03 +00:00

15 lines
539 B
C++

// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -o - %s | FileCheck %s
// CHECK-LABEL: define {{.*}}void @_Z2f0Pc
void f0(char *p) { }
// CHECK-LABEL: define {{.*}}void @_Z2f0PU3AS1c
void f0(char __attribute__((address_space(1))) *p) { }
struct OpaqueType;
typedef OpaqueType __attribute__((address_space(100))) * OpaqueTypePtr;
// CHECK-LABEL: define {{.*}}void @_Z2f0PU5AS10010OpaqueType
void f0(OpaqueTypePtr) { }
// CHECK-LABEL: define {{.*}}void @_Z2f1PU3AS1Kc
void f1(char __attribute__((address_space(1))) const *p) {}