34 lines · cpp
1// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +neon -verify -emit-llvm -o - -ferror-limit 100 %s2// REQUIRES: aarch64-registered-target3 4// Test that functions with the correct target attributes can use the correct SVE intrinsics.5// expected-no-diagnostics6 7#include <arm_sve.h>8 9void __attribute__((target("sve"))) test_sve(svint64_t x, svint64_t y)10{11 svzip2(x, y);12}13 14void __attribute__((target("sve,bf16"))) test_bfloat(svfloat32_t x, svbfloat16_t y, bfloat16_t z)15{16 svbfdot_n_f32(x, y, z);17}18 19void __attribute__((target("sve2"))) test_sve2(svbool_t pg)20{21 svlogb_f16_z(pg, svundef_f16());22}23 24void __attribute__((target("sve2-sha3"))) test_sve2_sha3()25{26 svrax1_s64(svundef_s64(), svundef_s64());27}28 29void __attribute__((target("sve2"))) test_f16(svbool_t pg)30{31 svlogb_f16_z(pg, svundef_f16());32}33 34