xref: /aosp_15_r20/external/llvm-libc/test/include/isnan_test.c (revision 71db0c75aadcf003ffe3238005f61d7618a3fead)
1 //===-- Unittests for isnan macro -----------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDSList-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 #include "include/llvm-libc-macros/math-function-macros.h"
9 
10 #include <assert.h>
11 
12 // check if macro is defined
13 #ifndef isnan
14 #error "isnan macro is not defined"
15 #else
main(void)16 int main(void) {
17   assert(!isnan(1.0f));
18   assert(!isnan(1.0));
19   assert(!isnan(1.0L));
20   return 0;
21 }
22 #endif
23