1//===-- Unittests for signbit 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// SPDX-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 signbit
14#error "signbit macro is not defined"
15#else
16int main(void) {
17 assert(!signbit(1.0f));
18 assert(!signbit(1.0));
19 assert(!signbit(1.0L));
20 assert(signbit(-1.0f));
21 assert(signbit(-1.0));
22 assert(signbit(-1.0L));
23 return 0;
24}
25#endif
26

Provided by KDAB

Privacy Policy
Update your C++ knowledge – Modern C++11/14/17 Training
Find out more

source code of libc/test/include/signbit_test.c