llvm-project/clang/test/CodeGenCXX/aarch64-mangle-sve-vectors.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
1001 B
C++
Raw Normal View History

Add SVE opaque built-in types This patch adds the SVE built-in types defined by the Procedure Call Standard for the Arm Architecture: https://developer.arm.com/docs/100986/0000 It handles the types in all relevant places that deal with built-in types. At the moment, some of these places bail out with an error, including: (1) trying to generate LLVM IR for the types (2) trying to generate debug info for the types (3) trying to mangle the types using the Microsoft C++ ABI (4) trying to @encode the types in Objective C (1) and (2) are fixed by follow-on patches but (unlike this patch) they deal mostly with target-specific LLVM details, so seemed like a logically separate change. There is currently no spec for (3) and (4), so reporting an error seems like the correct behaviour for now. The intention is that the types will become sizeless types: http://lists.llvm.org/pipermail/cfe-dev/2019-June/062523.html The main purpose of the sizeless type extension is to diagnose impossible or dangerous uses of the types, such as any that would require sizeof to have a meaningful defined value. Until then, the patch sets the alignments of the types to the values specified in the link above. It also sets the sizes of the types to zero, which is chosen to be consistently wrong and shouldn't affect correctly-written code (i.e. code that would compile even with the sizeless type extension). The patch adds the common subset of functionality needed to test the sizeless type extension on the one hand and to provide SVE intrinsic functions on the other. After this patch, the two pieces of work are essentially independent. The patch is based on one by Graham Hunter: https://reviews.llvm.org/D59245 Differential Revision: https://reviews.llvm.org/D62960 llvm-svn: 368413
2019-08-09 16:52:54 +08:00
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu %s -emit-llvm -o - \
// RUN: | FileCheck %s
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu %s -emit-llvm -o - \
// RUN: -target-feature +sve | FileCheck %s
template<typename T> struct S {};
// CHECK: _Z2f11SIu10__SVInt8_tE
void f1(S<__SVInt8_t>) {}
// CHECK: _Z2f21SIu11__SVInt16_tE
void f2(S<__SVInt16_t>) {}
// CHECK: _Z2f31SIu11__SVInt32_tE
void f3(S<__SVInt32_t>) {}
// CHECK: _Z2f41SIu11__SVInt64_tE
void f4(S<__SVInt64_t>) {}
// CHECK: _Z2f51SIu11__SVUint8_tE
void f5(S<__SVUint8_t>) {}
// CHECK: _Z2f61SIu12__SVUint16_tE
void f6(S<__SVUint16_t>) {}
// CHECK: _Z2f71SIu12__SVUint32_tE
void f7(S<__SVUint32_t>) {}
// CHECK: _Z2f81SIu12__SVUint64_tE
void f8(S<__SVUint64_t>) {}
// CHECK: _Z2f91SIu13__SVFloat16_tE
void f9(S<__SVFloat16_t>) {}
// CHECK: _Z3f101SIu13__SVFloat32_tE
void f10(S<__SVFloat32_t>) {}
// CHECK: _Z3f111SIu13__SVFloat64_tE
void f11(S<__SVFloat64_t>) {}
// CHECK: _Z3f121SIu10__SVBool_tE
void f12(S<__SVBool_t>) {}