1if(NOT LIBC_COMPILER_HAS_FIXED_POINT) 2 return() 3endif() 4 5add_custom_target(libc-stdfix-tests) 6 7foreach(suffix IN ITEMS hr r lr hk k lk) 8 add_libc_test( 9 abs${suffix}_test 10 SUITE 11 libc-stdfix-tests 12 HDRS 13 AbsTest.h 14 SRCS 15 abs${suffix}_test.cpp 16 COMPILE_OPTIONS 17 -O3 18 DEPENDS 19 libc.src.stdfix.abs${suffix} 20 libc.src.__support.fixed_point.fx_bits 21 ) 22endforeach() 23 24foreach(suffix IN ITEMS uhr ur ulr uhk uk) 25 add_libc_test( 26 sqrt${suffix}_test 27 SUITE 28 libc-stdfix-tests 29 HDRS 30 SqrtTest.h 31 SRCS 32 sqrt${suffix}_test.cpp 33 COMPILE_OPTIONS 34 -O3 35 DEPENDS 36 libc.src.stdfix.sqrt${suffix} 37 libc.src.__support.CPP.bit 38 libc.src.__support.fixed_point.fx_rep 39 libc.src.__support.fixed_point.sqrt 40 libc.src.__support.FPUtil.basic_operations 41 libc.src.__support.FPUtil.sqrt 42 ) 43endforeach() 44 45foreach(suffix IN ITEMS hr r lr hk k lk uhr ur ulr uhk uk ulk) 46 add_libc_test( 47 round${suffix}_test 48 SUITE 49 libc-stdfix-tests 50 HDRS 51 RoundTest.h 52 SRCS 53 round${suffix}_test.cpp 54 COMPILE_OPTIONS 55 -O3 56 DEPENDS 57 libc.src.stdfix.round${suffix} 58 libc.src.__support.fixed_point.fx_bits 59 ) 60 61 add_libc_test( 62 ${suffix}bits_test 63 SUITE 64 libc-stdfix-tests 65 HDRS 66 FxBitsTest.h 67 SRCS 68 ${suffix}bits_test.cpp 69 COMPILE_OPTIONS 70 -O3 71 DEPENDS 72 libc.src.stdfix.${suffix}bits 73 libc.src.__support.CPP.bit 74 libc.src.__support.fixed_point.fx_bits 75 ) 76endforeach() 77 78add_libc_test( 79 uhksqrtus_test 80 SUITE 81 libc-stdfix-tests 82 HDRS 83 ISqrtTest.h 84 SRCS 85 uhksqrtus_test.cpp 86 COMPILE_OPTIONS 87 -O3 88 DEPENDS 89 libc.src.stdfix.uhksqrtus 90 libc.src.__support.CPP.bit 91 libc.src.__support.fixed_point.fx_rep 92 libc.src.__support.fixed_point.sqrt 93 libc.src.__support.FPUtil.basic_operations 94 libc.src.__support.FPUtil.sqrt 95) 96 97add_libc_test( 98 uksqrtui_test 99 SUITE 100 libc-stdfix-tests 101 HDRS 102 ISqrtTest.h 103 SRCS 104 uksqrtui_test.cpp 105 COMPILE_OPTIONS 106 -O3 107 DEPENDS 108 libc.src.stdfix.uksqrtui 109 libc.src.__support.CPP.bit 110 libc.src.__support.fixed_point.fx_rep 111 libc.src.__support.fixed_point.sqrt 112 libc.src.__support.FPUtil.basic_operations 113 libc.src.__support.FPUtil.sqrt 114) 115 116add_libc_test( 117 exphk_test 118 SUITE 119 libc-stdfix-tests 120 HDRS 121 ExpTest.h 122 SRCS 123 exphk_test.cpp 124 COMPILE_OPTIONS 125 -O3 126 DEPENDS 127 libc.src.stdfix.exphk 128 libc.src.math.exp 129 libc.src.__support.CPP.bit 130 libc.src.__support.fixed_point.fx_rep 131 libc.src.__support.FPUtil.basic_operations 132) 133 134add_libc_test( 135 expk_test 136 SUITE 137 libc-stdfix-tests 138 HDRS 139 ExpTest.h 140 SRCS 141 expk_test.cpp 142 COMPILE_OPTIONS 143 -O3 144 DEPENDS 145 libc.src.stdfix.expk 146 libc.src.math.exp 147 libc.src.__support.CPP.bit 148 libc.src.__support.fixed_point.fx_rep 149 libc.src.__support.FPUtil.basic_operations 150) 151