[RISCV] Simplify usage of SplatPat_simm5_plus1. NFC (#125340)
[llvm-project.git] / clang / test / SemaCXX / attr-format-Float16.cpp
blobc61611d6b6a049ed74eb51dbc3c388eb1ee45c8f
1 // RUN: %clang_cc1 -fsyntax-only -verify -triple i686-linux-pc -target-feature +sse2 %s
2 // RUN: %clang_cc1 -fsyntax-only -verify -triple x86_64-linux-pc %s
3 // RUN: %clang_cc1 -fsyntax-only -verify -triple spir-unknown-unknown %s
4 // RUN: %clang_cc1 -fsyntax-only -verify -triple armv7a-linux-gnu %s
5 // RUN: %clang_cc1 -fsyntax-only -verify -triple aarch64-linux-gnu %s
6 // RUN: %clang_cc1 -fsyntax-only -verify -triple riscv32 %s
7 // RUN: %clang_cc1 -fsyntax-only -verify -triple riscv64 %s
9 template <typename... Args>
10 __attribute__((format(printf, 1, 2)))
11 void format(const char *fmt, Args &&...args); // expected-warning{{GCC requires a function with the 'format' attribute to be variadic}}
13 template<typename... Args>
14 __attribute__((format(scanf, 1, 2)))
15 int scan(const char *fmt, Args &&...args); // expected-warning{{GCC requires a function with the 'format' attribute to be variadic}}
17 void do_format() {
18 format("%f", (_Float16)123.f); // expected-warning{{format specifies type 'double' but the argument has type '_Float16'}}
20 _Float16 Float16;
21 scan("%f", &Float16); // expected-warning{{format specifies type 'float *' but the argument has type '_Float16 *'}}
22 scan("%lf", &Float16); // expected-warning{{format specifies type 'double *' but the argument has type '_Float16 *'}}
23 scan("%Lf", &Float16); // expected-warning{{format specifies type 'long double *' but the argument has type '_Float16 *'}}