[MemProf] Templatize CallStackRadixTreeBuilder (NFC) (#117014)
[llvm-project.git] / libc / test / include / isnormal_test.c
blobc076c5bfa2953afe90cda54fd27b54bd0fcc6d71
1 //===-- Unittests for isnormal 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"
10 #include <assert.h>
12 // check if macro is defined
13 #ifndef isnormal
14 #error "isnormal macro is not defined"
15 #else
16 int main(void) {
17 assert(isnormal(1.819f) == 1);
18 assert(isnormal(-1.726) == 1);
19 assert(isnormal(1.426L) == 1);
20 assert(isnormal(-0.0f) == 0);
21 assert(isnormal(0.0) == 0);
22 assert(isnormal(-0.0L) == 0);
23 return 0;
25 #endif