| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| //===-- Unittest for isfinite[l] macro ------------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDSList-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include "IsFiniteTest.h" | ||
| #include "include/llvm-libc-macros/math-function-macros.h" | ||
|
|
||
| LIST_ISFINITE_TESTS(long double, isfinite) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| //===-- Unittests for isinf macro -----------------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDSList-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
| #include "include/llvm-libc-macros/math-function-macros.h" | ||
|
|
||
| #include <assert.h> | ||
|
|
||
| // check if macro is defined | ||
| #ifndef isinf | ||
| #error "isinf macro is not defined" | ||
| #else | ||
| int main(void) { | ||
| assert(!isinf(1.0f)); | ||
| assert(!isinf(1.0)); | ||
| assert(!isinf(1.0L)); | ||
| return 0; | ||
| } | ||
| #endif |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| //===-- Unittest for isinf[d] macro ---------------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDSList-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include "IsInfTest.h" | ||
| #include "include/llvm-libc-macros/math-function-macros.h" | ||
|
|
||
| LIST_ISINF_TESTS(double, isinf) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| //===-- Unittest for isinf[f] macro ---------------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDSList-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include "IsInfTest.h" | ||
| #include "include/llvm-libc-macros/math-function-macros.h" | ||
|
|
||
| LIST_ISINF_TESTS(float, isinf) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| //===-- Unittest for isinf[l] macro ---------------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDSList-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include "IsInfTest.h" | ||
| #include "include/llvm-libc-macros/math-function-macros.h" | ||
|
|
||
| LIST_ISINF_TESTS(long double, isinf) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| //===-- Unittests for isnan macro -----------------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDSList-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
| #include "include/llvm-libc-macros/math-function-macros.h" | ||
|
|
||
| #include <assert.h> | ||
|
|
||
| // check if macro is defined | ||
| #ifndef isnan | ||
| #error "isnan macro is not defined" | ||
| #else | ||
| int main(void) { | ||
| assert(!isnan(1.0f)); | ||
| assert(!isnan(1.0)); | ||
| assert(!isnan(1.0L)); | ||
| return 0; | ||
| } | ||
| #endif |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| //===-- Unittest for isnan[l] macro ---------------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDSList-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include "IsNanTest.h" | ||
| #include "include/llvm-libc-macros/math-function-macros.h" | ||
|
|
||
| LIST_ISNAN_TESTS(double, isnan) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| //===-- Unittest for isnan[f] macro ---------------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDSList-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include "IsNanTest.h" | ||
| #include "include/llvm-libc-macros/math-function-macros.h" | ||
|
|
||
| LIST_ISNAN_TESTS(float, isnan) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| //===-- Unittest for isnan[l] macro ---------------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDSList-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include "IsNanTest.h" | ||
| #include "include/llvm-libc-macros/math-function-macros.h" | ||
|
|
||
| LIST_ISNAN_TESTS(long double, isnan) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| //===-- Unittests for signbit macro ---------------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDSList-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
| #include "include/llvm-libc-macros/math-function-macros.h" | ||
|
|
||
| #include <assert.h> | ||
|
|
||
| // check if macro is defined | ||
| #ifndef signbit | ||
| #error "signbit macro is not defined" | ||
| #else | ||
| int main(void) { | ||
| assert(!signbit(1.0f)); | ||
| assert(!signbit(1.0)); | ||
| assert(!signbit(1.0L)); | ||
| assert(signbit(-1.0f)); | ||
| assert(signbit(-1.0)); | ||
| assert(signbit(-1.0L)); | ||
| return 0; | ||
| } | ||
| #endif |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| //===-- Unittest for signbit [d] macro ------------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDSList-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include "SignbitTest.h" | ||
| #include "include/llvm-libc-macros/math-function-macros.h" | ||
|
|
||
| LIST_SIGNBIT_TESTS(double, signbit) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| //===-- Unittests for signbit [f] macro -----------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDSList-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include "SignbitTest.h" | ||
| #include "include/llvm-libc-macros/math-function-macros.h" | ||
|
|
||
| LIST_SIGNBIT_TESTS(float, signbit) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| //===-- Unittests for signbit[l] macro ------------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDSList-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include "SignbitTest.h" | ||
| #include "include/llvm-libc-macros/math-function-macros.h" | ||
|
|
||
| LIST_SIGNBIT_TESTS(long double, signbit) |