-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest_xstrchr.c
More file actions
28 lines (25 loc) · 836 Bytes
/
Copy pathtest_xstrchr.c
File metadata and controls
28 lines (25 loc) · 836 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <stdio.h>
#include <stdlib.h>
#pragma GCC diagnostic ignored "-Wformat"
extern const char* xstrchr(const char* string, char value);
extern const char* xstrchr_lods(const char* string, char value);
#ifdef __SSE2__
extern const char* xstrchr_sse2(const char* string, char value);
#endif
extern const char* c_xstrchr(const char* string, char value);
int main(int argc, char* argv[]) {
(void)argc;
for (++argv; *argv; ++argv) {
const char* result = xstrchr(*argv, '0');
printf("%i %ti\n", !!*result, result - *argv);
result = xstrchr_lods(*argv, '0');
printf("%i %ti\n", !!*result, result - *argv);
#ifdef __SSE2__
result = xstrchr_sse2(*argv, '0');
printf("%i %ti\n", !!*result, result - *argv);
#endif
result = c_xstrchr(*argv, '0');
printf("%i %ti\n", !!*result, result - *argv);
}
return EXIT_SUCCESS;
}