Clang Project

clang_source_code/test/SemaCXX/Float16.cpp
1// RUN: %clang_cc1 -fsyntax-only -verify -triple x86_64-linux-pc %s
2// RUN: %clang_cc1 -fsyntax-only -verify -triple spir-unknown-unknown %s -DHAVE
3// RUN: %clang_cc1 -fsyntax-only -verify -triple armv7a-linux-gnu %s -DHAVE
4// RUN: %clang_cc1 -fsyntax-only -verify -triple aarch64-linux-gnu %s -DHAVE
5
6#ifdef HAVE
7// expected-no-diagnostics
8#endif // HAVE
9
10#ifndef HAVE
11// expected-error@+2{{_Float16 is not supported on this target}}
12#endif // !HAVE
13_Float16 f;
14
15#ifndef HAVE
16// expected-error@+2{{invalid suffix 'F16' on floating constant}}
17#endif // !HAVE
18const auto g = 1.1F16;
19