1 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +neon -verify -emit-llvm -o - %s 2 // REQUIRES: aarch64-registered-target 3 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"))) test_fullfp16(float16_t f16)9void test_fullfp16(float16_t f16) { 10 vabdh_f16(f16, f16); 11 } 12 13 __attribute__((target("fp16"))) fp16(float16_t f16)14void fp16(float16_t f16) { 15 vabdh_f16(f16, f16); 16 } 17 18 __attribute__((target("arch=armv8-a+fp16"))) test_fp16_arch(float16_t f16)19void test_fp16_arch(float16_t f16) { 20 vabdh_f16(f16, f16); 21 } 22 23 __attribute__((target("+fp16"))) test_plusfp16(float16_t f16)24void test_plusfp16(float16_t f16) { 25 vabdh_f16(f16, f16); 26 } 27 undefined(float16_t f16)28void undefined(float16_t f16) { 29 vabdh_f16(f16, f16); // expected-error {{'__builtin_neon_vabdh_f16' needs target feature fullfp16}} 30 } 31