[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / Sema / aarch64-fp16-target.c
blob9d84cca84482fef0dd1baef800b2391c4f10d315
1 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +neon -fsyntax-only -verify -emit-llvm -o - %s
2 // REQUIRES: aarch64-registered-target
4 // Test that functions with the correct target attributes can use the correct FP16 intrinsics.
6 #include <arm_fp16.h>
8 __attribute__((target("fullfp16")))
9 void test_fullfp16(float16_t f16) {
10 vabdh_f16(f16, f16);
13 __attribute__((target("fp16")))
14 void fp16(float16_t f16) {
15 vabdh_f16(f16, f16);
18 __attribute__((target("arch=armv8-a+fp16")))
19 void test_fp16_arch(float16_t f16) {
20 vabdh_f16(f16, f16);
23 __attribute__((target("+fp16")))
24 void test_plusfp16(float16_t f16) {
25 vabdh_f16(f16, f16);
28 void undefined(float16_t f16) {
29 vabdh_f16(f16, f16); // expected-error {{'__builtin_neon_vabdh_f16' needs target feature fullfp16}}