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