/bionic/tests/ |
D | ctype_test.cpp | 30 for (int i = kMin; i < kMax; ++i) { in TEST() local 31 if ((i >= '0' && i <= '9') || in TEST() 32 (i >= 'A' && i <= 'Z') || in TEST() 33 (i >= 'a' && i <= 'z')) { in TEST() 34 EXPECT_TRUE(isalnum(i)) << i; in TEST() 36 EXPECT_FALSE(isalnum(i)) << i; in TEST() 42 for (int i = kMin; i < kMax; ++i) { in TEST() local 43 if ((i >= '0' && i <= '9') || in TEST() 44 (i >= 'A' && i <= 'Z') || in TEST() 45 (i >= 'a' && i <= 'z')) { in TEST() [all …]
|
D | sched_test.cpp | 33 int i = 0; in TEST() local 34 pid_t tid = clone(child_fn, &child_stack[1024], CLONE_VM, &i); in TEST() 39 ASSERT_EQ(42, i); in TEST() 64 int i = 0; in TEST() local 66 ASSERT_EQ(-1, clone(child_fn, nullptr, CLONE_VM, &i)); in TEST() 76 for (int i = 0; i < CPU_SETSIZE; i++) { in TEST() local 77 ASSERT_EQ(i == 0 || i == 17, CPU_ISSET(i, &set)); in TEST() 102 for (int i = 0; i < CPU_SETSIZE; i++) { in TEST() local 103 ASSERT_FALSE(CPU_ISSET(i, &set)); in TEST() 113 for (int i = 0; i < CPU_SETSIZE; i++) { in TEST() local [all …]
|
D | malloc_test.cpp | 81 for (size_t i = 0; i < alloc_len; i++) { in TEST() local 82 ASSERT_EQ(0, ptr[i]); in TEST() 113 for (size_t i = 0; i <= 12; i++) { in TEST() local 114 for (size_t alignment = 1 << i; alignment < (1U << (i+1)); alignment++) { in TEST() 118 ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(ptr) % ((1U << i))) in TEST() 153 for (size_t i = 0; i < 100; i++) { in TEST() local 154 ASSERT_EQ(0x23, ptr[i]); in TEST() 161 for (size_t i = 0; i < 200; i++) { in TEST() local 162 ASSERT_EQ(0x45, ptr[i]); in TEST() 169 for (size_t i = 0; i < 250; i++) { in TEST() local [all …]
|
D | __cxa_atexit_test.cpp | 56 for (int i = 0; i < 500; ++i) { in TEST() local 57 __cxxabiv1::__cxa_atexit(append_to_actual, new int{i}, &handles[i % 2]); in TEST() 62 for (int i = 500; i < 750; ++i) { in TEST() local 63 __cxxabiv1::__cxa_atexit(append_to_actual, new int{i}, &handles[1]); in TEST() 69 for (int i = 498; i >= 0; i -= 2) expected.push_back(i); in TEST() local 70 for (int i = 749; i >= 500; --i) expected.push_back(i); in TEST() local 71 for (int i = 499; i >= 1; i -= 2) expected.push_back(i); in TEST() local 74 for (size_t i = 0; i < expected.size(); ++i) { in TEST() local 75 ASSERT_EQ(expected[i], actual[i]) << "index=" << i; in TEST()
|
D | math_data_test.h | 171 for (size_t i = 0; i < N; ++i) { 173 data[i].expected, f(data[i].input)) << "Failed on element " << i; 183 for (size_t i = 0; i < N; ++i) { 184 EXPECT_EQ(data[i].expected, f(data[i].input)) << "Failed on element " << i; 194 for (size_t i = 0; i < N; ++i) { 195 EXPECT_EQ(data[i].expected, f(data[i].input)) << "Failed on element " << i; 205 for (size_t i = 0; i < N; ++i) { 206 EXPECT_EQ(data[i].expected, f(data[i].input)) << "Failed on element " << i; 217 for (size_t i = 0; i < N; ++i) { 219 … data[i].expected, f(data[i].input1, data[i].input2)) << "Failed on element " << i; [all …]
|
D | stdatomic_test.cpp | 90 atomic_int i; in TEST() local 91 atomic_store(&i, 123); in TEST() 92 ASSERT_EQ(123, atomic_load(&i)); in TEST() 93 atomic_store_explicit(&i, 123, memory_order_relaxed); in TEST() 94 ASSERT_EQ(123, atomic_load_explicit(&i, memory_order_relaxed)); in TEST() 98 atomic_int i; in TEST() local 99 atomic_store(&i, 123); in TEST() 100 ASSERT_EQ(123, atomic_exchange(&i, 456)); in TEST() 101 ASSERT_EQ(456, atomic_exchange_explicit(&i, 123, memory_order_relaxed)); in TEST() 105 atomic_int i; in TEST() local [all …]
|
D | buffer_tests.cpp | 210 for (int i = 0; i < FENCEPOST_LENGTH; i += 2) { in SetFencepost() local 211 buffer[i] = 0xde; in SetFencepost() 212 buffer[i+1] = 0xad; in SetFencepost() 217 for (int i = 0; i < FENCEPOST_LENGTH; i += 2) { in VerifyFencepost() local 218 if (buffer[i] != 0xde || buffer[i+1] != 0xad) { in VerifyFencepost() 220 if (buffer[i] == 0xde) { in VerifyFencepost() 221 i++; in VerifyFencepost() 226 ASSERT_EQ(expected_value, buffer[i]); in VerifyFencepost() 250 for (size_t i = 0; i < g_single_aligns_len; i++) { in RunSingleBufferAlignTest() local 256 buf+FENCEPOST_LENGTH, g_single_aligns[i][0], g_single_aligns[i][1])); in RunSingleBufferAlignTest() [all …]
|
D | sys_socket_test.cpp | 129 for (size_t i = 0; i < NUM_RECV_MSGS; i++) { in SendMultiple() local 130 if (send(fd, g_RecvMsgs[i], strlen(g_RecvMsgs[i]) + 1, 0) < 0) { in SendMultiple() 149 for (size_t i = 0; i < NUM_RECV_MSGS; i++) { in TestRecvMMsg() local 150 io[i].iov_base = reinterpret_cast<void*>(bufs[i]); in TestRecvMMsg() 151 io[i].iov_len = strlen(g_RecvMsgs[i]) + 1; in TestRecvMMsg() 153 msgs[i].msg_hdr.msg_iov = &io[i]; in TestRecvMMsg() 154 msgs[i].msg_hdr.msg_iovlen = 1; in TestRecvMMsg() 155 msgs[i].msg_len = sizeof(struct msghdr); in TestRecvMMsg() 165 for (size_t i = 0; i < NUM_RECV_MSGS; i++) { in TestRecvMMsg() local 166 ASSERT_STREQ(g_RecvMsgs[i], bufs[i]); in TestRecvMMsg() [all …]
|
D | string_test.cpp | 48 static int signum(int i) { in signum() argument 49 if (i < 0) { in signum() 51 } else if (i > 0) { in signum() 229 for (size_t i = 1; i < ITER; ++i) { in InitLenArray() local 230 size_t l = static_cast<size_t>(exp(log(static_cast<double>(MAX_LEN)) * i / ITER)); in InitLenArray() 257 for (size_t i = 1; i < state.n; i++) { in TEST() local 263 memset(state.ptr1, 'L', state.len[i]); in TEST() 264 state.ptr1[random() % state.len[i]] = '\0'; in TEST() 265 state.ptr1[state.len[i] - 1] = '\0'; in TEST() 429 for (size_t i = 0; i < sizeof(str) - 1; i++) { in TEST() local [all …]
|
/bionic/libm/upstream-freebsd/lib/msun/src/ |
D | k_rem_pio2.c | 296 int32_t jz,jx,jv,jp,jk,carry,n,iq[20],i,j,k,m,q0,ih; in __kernel_rem_pio2() local 310 for(i=0;i<=m;i++,j++) f[i] = (j<0)? zero : (double) ipio2[j]; in __kernel_rem_pio2() 313 for (i=0;i<=jk;i++) { in __kernel_rem_pio2() 314 for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j]; q[i] = fw; in __kernel_rem_pio2() 320 for(i=0,j=jz,z=q[jz];j>0;i++,j--) { in __kernel_rem_pio2() 322 iq[i] = (int32_t)(z-two24*fw); in __kernel_rem_pio2() 333 i = (iq[jz-1]>>(24-q0)); n += i; in __kernel_rem_pio2() 334 iq[jz-1] -= i<<(24-q0); in __kernel_rem_pio2() 342 for(i=0;i<jz ;i++) { /* compute 1-q */ in __kernel_rem_pio2() 343 j = iq[i]; in __kernel_rem_pio2() [all …]
|
D | e_jnf.c | 37 int32_t i,hx,ix, sgn; in __ieee754_jnf() local 63 for(i=1;i<n;i++){ in __ieee754_jnf() 65 b = b*((float)(i+i)/x) - a; /* avoid underflow */ in __ieee754_jnf() 77 for (a=one,i=2;i<=n;i++) { in __ieee754_jnf() 78 a *= (float)i; /* a = n! */ in __ieee754_jnf() 124 for(t=zero, i = 2*(n+k); i>=m; i -= 2) t = one/(i/x-t); in __ieee754_jnf() 139 for(i=n-1,di=(float)(i+i);i>0;i--){ in __ieee754_jnf() 147 for(i=n-1,di=(float)(i+i);i>0;i--){ in __ieee754_jnf() 175 int32_t i,hx,ix,ib; in __ieee754_ynf() local 197 for(i=1;i<n&&ib!=0xff800000;i++){ in __ieee754_ynf() [all …]
|
D | e_jn.c | 56 int32_t i,hx,ix,lx, sgn; in __ieee754_jn() local 105 for(i=1;i<n;i++){ in __ieee754_jn() 107 b = b*((double)(i+i)/x) - a; /* avoid underflow */ in __ieee754_jn() 120 for (a=one,i=2;i<=n;i++) { in __ieee754_jn() 121 a *= (double)i; /* a = n! */ in __ieee754_jn() 167 for(t=zero, i = 2*(n+k); i>=m; i -= 2) t = one/(i/x-t); in __ieee754_jn() 182 for(i=n-1,di=(double)(i+i);i>0;i--){ in __ieee754_jn() 190 for(i=n-1,di=(double)(i+i);i>0;i--){ in __ieee754_jn() 218 int32_t i,hx,ix,lx; in __ieee754_yn() local 266 for(i=1;i<n&&high!=0xfff00000;i++){ in __ieee754_yn() [all …]
|
/bionic/benchmarks/ |
D | property_benchmark.cpp | 55 for (int i = 0; i < nprops; i++) { in LocalPropertyTestState() local 58 name_lens[i] = (random() % (PROP_NAME_MAX - 10)) + 10; in LocalPropertyTestState() 59 names[i] = new char[PROP_NAME_MAX + 1]; in LocalPropertyTestState() 61 for (int j = 0; j < name_lens[i]; j++) { in LocalPropertyTestState() 62 if (j == 0 || names[i][j-1] == '.' || j == name_lens[i] - 1) { in LocalPropertyTestState() 72 names[i][j] = prop_name_chars[random() % prop_name_len]; in LocalPropertyTestState() 74 names[i][name_lens[i]] = 0; in LocalPropertyTestState() 77 value_lens[i] = (random() % (PROP_VALUE_MAX - 1)) + 1; in LocalPropertyTestState() 78 values[i] = new char[PROP_VALUE_MAX]; in LocalPropertyTestState() 79 for (int j = 0; j < value_lens[i]; j++) { in LocalPropertyTestState() [all …]
|
D | malloc_sql_benchmark.cpp | 56 for (size_t i = 0; i < total_entries; i++) { in BenchmarkMalloc() local 57 switch (entries[i].type) { in BenchmarkMalloc() 59 ptrs[entries[i].idx] = malloc(entries[i].size); in BenchmarkMalloc() 62 reinterpret_cast<uint8_t*>(ptrs[entries[i].idx])[0] = 10; in BenchmarkMalloc() 65 ptrs[entries[i].idx] = calloc(entries[i].arg2, entries[i].size); in BenchmarkMalloc() 68 reinterpret_cast<uint8_t*>(ptrs[entries[i].idx])[0] = 20; in BenchmarkMalloc() 71 ptrs[entries[i].idx] = memalign(entries[i].arg2, entries[i].size); in BenchmarkMalloc() 74 reinterpret_cast<uint8_t*>(ptrs[entries[i].idx])[0] = 30; in BenchmarkMalloc() 77 if (entries[i].arg2 == 0) { in BenchmarkMalloc() 78 ptrs[entries[i].idx] = realloc(nullptr, entries[i].size); in BenchmarkMalloc() [all …]
|
D | stdlib_benchmark.cpp | 101 for (size_t i = 0; i < numAllocs; i++) { in MallocMultiple() local 102 benchmark::DoNotOptimize(ptrs[i] = reinterpret_cast<uint8_t*>(malloc(nbytes))); in MallocMultiple() 103 MakeAllocationResident(ptrs[i], nbytes, pagesize); in MallocMultiple() 106 for (size_t i = 0; i < numAllocs; i++) { in MallocMultiple() local 107 free(ptrs[i]); in MallocMultiple() 177 size_t i, j, k, l; in BM_stdlib_mbstowcs() local 179 for (i=0xc3; i<0xe0; i++) in BM_stdlib_mbstowcs() 181 buf[l++] = i, buf[l++] = j; in BM_stdlib_mbstowcs() 182 for (i=0xe1; i<0xed; i++) in BM_stdlib_mbstowcs() 185 buf[l++] = i, buf[l++] = j, buf[l++] = k; in BM_stdlib_mbstowcs() [all …]
|
/bionic/tests/headers/posix/ |
D | signal_h.c | 70 int i; in signal_h() local 71 i = SIGRTMIN; in signal_h() 72 i = SIGRTMAX; in signal_h() 109 i = SIG_BLOCK; in signal_h() 110 i = SIG_UNBLOCK; in signal_h() 111 i = SIG_SETMASK; in signal_h() 151 i = ILL_ILLOPC; in signal_h() 152 i = ILL_ILLOPN; in signal_h() 153 i = ILL_ILLADR; in signal_h() 154 i = ILL_ILLTRP; in signal_h() [all …]
|
/bionic/libc/tools/ |
D | generate-NOTICE.py | 51 def extract_copyright_at(lines, i): argument 52 hash = lines[i].startswith("#") 55 start = i 64 while i < len(lines): 65 if "*/" in lines[i]: 67 if hash and len(lines[i]) == 0: 69 …if "\t@(#)" in lines[i] or "\tfrom: @(#)" in lines[i] or "From: @(#)" in lines[i] or "from OpenBSD… 71 if "\tcitrus Id: " in lines[i]: 73 …if "\t$Citrus: " in lines[i] or "\t$OpenBSD: " in lines[i] or " $FreeBSD: " in lines[i] or "\t$Net… 75 if "$FreeBSD$" in lines[i] or "$Citrus$" in lines[i]: [all …]
|
/bionic/libc/bionic/ |
D | wchar.cpp | 71 size_t i, o, r; in mbsnrtowcs() local 82 for (i = o = 0; i < nmc; i += r, o++) { in mbsnrtowcs() 83 if (static_cast<uint8_t>((*src)[i]) < 0x80) { in mbsnrtowcs() 85 if ((*src)[i] == '\0') { in mbsnrtowcs() 90 r = mbrtowc(nullptr, *src + i, nmc - i, state); in mbsnrtowcs() 106 for (i = o = 0; i < nmc && o < len; i += r, o++) { in mbsnrtowcs() 107 if (static_cast<uint8_t>((*src)[i]) < 0x80) { in mbsnrtowcs() 109 dst[o] = (*src)[i]; in mbsnrtowcs() 111 if ((*src)[i] == '\0') { in mbsnrtowcs() 116 r = mbrtowc(dst + o, *src + i, nmc - i, state); in mbsnrtowcs() [all …]
|
/bionic/libc/system_properties/ |
D | contexts_serialized.cpp | 61 for (size_t i = 0; i < num_context_nodes; ++i) { in InitializeContextNodes() local 62 new (&context_nodes_[i]) ContextNode(property_info_area_file_->context(i), filename_); in InitializeContextNodes() 111 for (size_t i = 0; i < num_context_nodes_; ++i) { in Initialize() local 112 if (!context_nodes_[i].Open(true, fsetxattr_failed)) { in Initialize() 148 for (size_t i = 0; i < num_context_nodes_; ++i) { in ForEach() local 149 if (context_nodes_[i].CheckAccessAndOpen()) { in ForEach() 150 context_nodes_[i].pa()->foreach (propfn, cookie); in ForEach() 156 for (size_t i = 0; i < num_context_nodes_; ++i) { in ResetAccess() local 157 context_nodes_[i].ResetAccess(); in ResetAccess() 164 for (size_t i = 0; i < num_context_nodes_; ++i) { in FreeAndUnmap() local [all …]
|
/bionic/libc/upstream-openbsd/lib/libc/gdtoa/ |
D | dtoa.c | 118 int bbits, b2, b5, be, dig, i, ieps, ilim, ilim0, ilim1, local 204 i = (int)(word0(&d) >> Exp_shift1 & (Exp_mask>>Exp_shift1)); 206 if (( i = (int)(word0(&d) >> Exp_shift1 & (Exp_mask>>Exp_shift1)) )!=0) { 238 i -= Bias; 240 i <<= 2; 241 i += j; 249 i = bbits + be + (Bias + (P-1) - 1); 250 x = i > 32 ? word0(&d) << (64 - i) | word1(&d) >> (i - 32) 251 : word1(&d) << (32 - i); 254 i -= (Bias + (P-1) - 1) + 1; [all …]
|
D | gdtoa.c | 41 int i, k; local 45 i = ULbits; 47 while(i < nbits) { 48 i <<= 1; 66 i = x - x0; 67 while(!x0[--i]) 68 if (!i) { 73 b->wds = i + 1; 74 *bbits = i*ULbits + 32 - hi0bits(b->x[i]); 158 int bbits, b2, b5, be0, dig, i, ieps, ilim, ilim0, ilim1, inex; local [all …]
|
D | hexnan.c | 36 L_shift(x, x1, i) ULong *x; ULong *x1; int i; in L_shift() argument 38 L_shift(ULong *x, ULong *x1, int i) 43 i = 8 - i; 44 i <<= 2; 45 j = ULbits - i; 48 x[1] >>= i; 62 int havedig, hd0, i, nbits; local 72 havedig = hd0 = i = 0; 84 if (x < x1 && i < 8) 85 L_shift(x, x1, i); [all …]
|
/bionic/libc/tzcode/ |
D | localtime.c | 221 register int i; in detzcode() local 228 for (i = 1; i < 4; ++i) in detzcode() 229 result = (result << 8) | (codep[i] & 0xff); in detzcode() 244 register int i; in detzcode64() local 251 for (i = 1; i < 8; ++i) in detzcode64() 252 result = (result << 8) | (codep[i] & 0xff); in detzcode64() 281 register int i; in settzname() local 298 for (i = 0; i < sp->typecnt; ++i) { in settzname() 299 register const struct ttinfo * const ttisp = &sp->ttis[i]; in settzname() 302 for (i = 0; i < sp->timecnt; ++i) { in settzname() [all …]
|
/bionic/libc/upstream-openbsd/lib/libc/net/ |
D | inet_ntop.c | 107 int i; in inet_ntop6() local 116 for (i = 0; i < IN6ADDRSZ; i++) in inet_ntop6() 117 words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3)); in inet_ntop6() 120 for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++) { in inet_ntop6() 121 if (words[i] == 0) { in inet_ntop6() 123 cur.base = i, cur.len = 1; in inet_ntop6() 146 for (i = 0; i < (IN6ADDRSZ / INT16SZ) && tp < ep; i++) { in inet_ntop6() 148 if (best.base != -1 && i >= best.base && in inet_ntop6() 149 i < (best.base + best.len)) { in inet_ntop6() 150 if (i == best.base) { in inet_ntop6() [all …]
|
/bionic/linker/ |
D | linker_gnu_hash_test.cpp | 43 for (size_t i = 0; i < sizeof(test1) - 1; ++i) { in TEST() local 44 check_input(&test1[i]); in TEST() 48 for (size_t i = 0; i < sizeof(test2) - 1; ++i) { in TEST() local 49 check_input(&test2[i]); in TEST() 53 for (size_t i = 0; i < sizeof(test3) - 1; ++i) { in TEST() local 54 check_input(&test3[i]); in TEST()
|