31 lines · c
1// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +neon -verify -emit-llvm -o - %s2// REQUIRES: aarch64-registered-target3 4// Test that functions with the correct target attributes can use the correct FP16 intrinsics.5 6#include <arm_fp16.h>7 8__attribute__((target("fullfp16")))9void test_fullfp16(float16_t f16) {10 vabdh_f16(f16, f16);11}12 13__attribute__((target("fp16")))14void fp16(float16_t f16) {15 vabdh_f16(f16, f16);16}17 18__attribute__((target("arch=armv8-a+fp16")))19void test_fp16_arch(float16_t f16) {20 vabdh_f16(f16, f16);21}22 23__attribute__((target("+fp16")))24void test_plusfp16(float16_t f16) {25 vabdh_f16(f16, f16);26}27 28void undefined(float16_t f16) {29 vabdh_f16(f16, f16); // expected-error {{'__builtin_neon_vabdh_f16' needs target feature fullfp16}}30}31