diff options
| author | Silviu Baranga <silviu.baranga@arm.com> | 2016-04-29 15:03:32 +0000 |
|---|---|---|
| committer | Silviu Baranga <silviu.baranga@arm.com> | 2016-04-29 15:03:32 +0000 |
| commit | 3102a012582cdc95b9a4ca1685e1428a75a077d4 (patch) | |
| tree | 5beb7a2da722ba47f5abb27a1fc6cde7651587ff /clang/test/Sema | |
| parent | 14824b1c52b07b10ba6a9545f7f50bd72673b69c (diff) | |
| download | bcm5719-llvm-3102a012582cdc95b9a4ca1685e1428a75a077d4.tar.gz bcm5719-llvm-3102a012582cdc95b9a4ca1685e1428a75a077d4.zip | |
[ARM] Guard the declarations of f16 to f32 vcvt intrinsics in arm_neon.h by testing __ARM_FP
Summary:
Conversions between float and half are only available when the
taraget has the half-precision extension. Guard these intrinsics
so that they don't cause crashes in the backend.
Fixes PR27550.
Reviewers: rengolin, t.p.northover
Subscribers: cfe-commits, aemerson, t.p.northover, rengolin
Differential Revision: http://reviews.llvm.org/D19665
llvm-svn: 268047
Diffstat (limited to 'clang/test/Sema')
| -rw-r--r-- | clang/test/Sema/arm-no-fp16.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/Sema/arm-no-fp16.c b/clang/test/Sema/arm-no-fp16.c new file mode 100644 index 00000000000..6443d83198c --- /dev/null +++ b/clang/test/Sema/arm-no-fp16.c @@ -0,0 +1,11 @@ +// RUN: %clang_cc1 -triple thumbv7-none-eabi %s -target-feature +neon -target-feature -fp16 -fsyntax-only -verify + +#include <arm_neon.h> + +float16x4_t test_vcvt_f16_f32(float32x4_t a) { + return vcvt_f16_f32(a); // expected-warning{{implicit declaration of function 'vcvt_f16_f32'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x4_t'}} +} + +float32x4_t test_vcvt_f32_f16(float16x4_t a) { + return vcvt_f32_f16(a); // expected-warning{{implicit declaration of function 'vcvt_f32_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float32x4_t'}} +} |

