Author: David Green Date: 2022-11-03T15:18:36Z New Revision: 3edd18876950693cbc69edda429f223616e3c052
URL: https://github.com/llvm/llvm-project/commit/3edd18876950693cbc69edda429f223616e3c052 DIFF: https://github.com/llvm/llvm-project/commit/3edd18876950693cbc69edda429f223616e3c052.diff LOG: [AArch64] Add a baseline test for fp16 target intrinsics. NFC Added: clang/test/Sema/aarch64-fp16-target.c Modified: Removed: ################################################################################ diff --git a/clang/test/Sema/aarch64-fp16-target.c b/clang/test/Sema/aarch64-fp16-target.c new file mode 100644 index 0000000000000..13cee64c52f56 --- /dev/null +++ b/clang/test/Sema/aarch64-fp16-target.c @@ -0,0 +1,25 @@ +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +neon -fsyntax-only -verify -emit-llvm -o - %s +// REQUIRES: aarch64-registered-target + +// Test that functions with the correct target attributes can use the correct FP16 intrinsics. + +#include <arm_fp16.h> + +__attribute__((target("fullfp16"))) +void test_fullfp16(float16_t f16) { + vabdh_f16(f16, f16); // expected-error {{call to undeclared function 'vabdh_f16'}} +} + +__attribute__((target("arch=armv8-a+fp16"))) +void test_fp16_arch(float16_t f16) { + vabdh_f16(f16, f16); // expected-error {{call to undeclared function 'vabdh_f16'}} +} + +__attribute__((target("+fp16"))) +void test_fp16(float16_t f16) { + vabdh_f16(f16, f16); // expected-error {{call to undeclared function 'vabdh_f16'}} +} + +void undefined(float16_t f16) { + vabdh_f16(f16, f16); // expected-error {{call to undeclared function 'vabdh_f16'}} +} _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits