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.

101 lines
3.3 KiB
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>) {}
// The tuple types don't use the internal name for mangling.
// CHECK: _Z3f131SI10svint8x2_tE
void f13(S<__clang_svint8x2_t>) {}
// CHECK: _Z3f141SI10svint8x3_tE
void f14(S<__clang_svint8x3_t>) {}
// CHECK: _Z3f151SI10svint8x4_tE
void f15(S<__clang_svint8x4_t>) {}
// CHECK: _Z3f161SI11svint16x2_tE
void f16(S<__clang_svint16x2_t>) {}
// CHECK: _Z3f171SI11svint16x3_tE
void f17(S<__clang_svint16x3_t>) {}
// CHECK: _Z3f181SI11svint16x4_tE
void f18(S<__clang_svint16x4_t>) {}
// CHECK: _Z3f191SI11svint32x2_tE
void f19(S<__clang_svint32x2_t>) {}
// CHECK: _Z3f201SI11svint32x3_tE
void f20(S<__clang_svint32x3_t>) {}
// CHECK: _Z3f211SI11svint32x4_tE
void f21(S<__clang_svint32x4_t>) {}
// CHECK: _Z3f221SI11svint64x2_tE
void f22(S<__clang_svint64x2_t>) {}
// CHECK: _Z3f231SI11svint64x3_tE
void f23(S<__clang_svint64x3_t>) {}
// CHECK: _Z3f241SI11svint64x4_tE
void f24(S<__clang_svint64x4_t>) {}
// CHECK: _Z3f251SI11svuint8x2_tE
void f25(S<__clang_svuint8x2_t>) {}
// CHECK: _Z3f261SI11svuint8x3_tE
void f26(S<__clang_svuint8x3_t>) {}
// CHECK: _Z3f271SI11svuint8x4_tE
void f27(S<__clang_svuint8x4_t>) {}
// CHECK: _Z3f281SI12svuint16x2_tE
void f28(S<__clang_svuint16x2_t>) {}
// CHECK: _Z3f291SI12svuint16x3_tE
void f29(S<__clang_svuint16x3_t>) {}
// CHECK: _Z3f301SI12svuint16x4_tE
void f30(S<__clang_svuint16x4_t>) {}
// CHECK: _Z3f311SI12svuint32x2_tE
void f31(S<__clang_svuint32x2_t>) {}
// CHECK: _Z3f321SI12svuint32x3_tE
void f32(S<__clang_svuint32x3_t>) {}
// CHECK: _Z3f331SI12svuint32x4_tE
void f33(S<__clang_svuint32x4_t>) {}
// CHECK: _Z3f341SI12svuint64x2_tE
void f34(S<__clang_svuint64x2_t>) {}
// CHECK: _Z3f351SI12svuint64x3_tE
void f35(S<__clang_svuint64x3_t>) {}
// CHECK: _Z3f361SI12svuint64x4_tE
void f36(S<__clang_svuint64x4_t>) {}
// CHECK: _Z3f371SI13svfloat16x2_tE
void f37(S<__clang_svfloat16x2_t>) {}
// CHECK: _Z3f381SI13svfloat16x3_tE
void f38(S<__clang_svfloat16x3_t>) {}
// CHECK: _Z3f391SI13svfloat16x4_tE
void f39(S<__clang_svfloat16x4_t>) {}
// CHECK: _Z3f401SI13svfloat32x2_tE
void f40(S<__clang_svfloat32x2_t>) {}
// CHECK: _Z3f411SI13svfloat32x3_tE
void f41(S<__clang_svfloat32x3_t>) {}
// CHECK: _Z3f421SI13svfloat32x4_tE
void f42(S<__clang_svfloat32x4_t>) {}
// CHECK: _Z3f431SI13svfloat64x2_tE
void f43(S<__clang_svfloat64x2_t>) {}
// CHECK: _Z3f441SI13svfloat64x3_tE
void f44(S<__clang_svfloat64x3_t>) {}
// CHECK: _Z3f451SI13svfloat64x4_tE
void f45(S<__clang_svfloat64x4_t>) {}