]> git.wh0rd.org - ICEs.git/blame - bfin-strcmp/test.i.1
initial import
[ICEs.git] / bfin-strcmp / test.i.1
CommitLineData
45516216 1
2
3
4
5
6
7typedef long unsigned int size_t;
8
9
10
11typedef unsigned short __kernel_dev_t;
12typedef unsigned long __kernel_ino_t;
13typedef unsigned short __kernel_mode_t;
14typedef unsigned short __kernel_nlink_t;
15typedef long __kernel_off_t;
16typedef int __kernel_pid_t;
17typedef unsigned int __kernel_ipc_pid_t;
18typedef unsigned int __kernel_uid_t;
19typedef unsigned int __kernel_gid_t;
20typedef unsigned int __kernel_size_t;
21typedef int __kernel_ssize_t;
22typedef int __kernel_ptrdiff_t;
23typedef long __kernel_time_t;
24typedef long __kernel_suseconds_t;
25typedef long __kernel_clock_t;
26typedef int __kernel_daddr_t;
27typedef char * __kernel_caddr_t;
28typedef unsigned short __kernel_uid16_t;
29typedef unsigned short __kernel_gid16_t;
30typedef unsigned int __kernel_uid32_t;
31typedef unsigned int __kernel_gid32_t;
32typedef unsigned short __kernel_old_uid_t;
33typedef unsigned short __kernel_old_gid_t;
34typedef long long __kernel_loff_t;
35typedef __kernel_dev_t __kernel_old_dev_t;
36
37typedef struct {
38
39
40
41 int __val[2];
42
43} __kernel_fsid_t;
44
45
46typedef unsigned char __u_char;
47typedef unsigned short int __u_short;
48typedef unsigned int __u_int;
49typedef unsigned long int __u_long;
50
51
52typedef signed char __int8_t;
53typedef unsigned char __uint8_t;
54typedef signed short int __int16_t;
55typedef unsigned short int __uint16_t;
56typedef signed int __int32_t;
57typedef unsigned int __uint32_t;
58
59
60
61
62__extension__ typedef signed long long int __int64_t;
63__extension__ typedef unsigned long long int __uint64_t;
64
65
66
67
68
69
70
71__extension__ typedef long long int __quad_t;
72__extension__ typedef unsigned long long int __u_quad_t;
73
74
75__extension__ typedef __u_quad_t __dev_t;
76__extension__ typedef unsigned int __uid_t;
77__extension__ typedef unsigned int __gid_t;
78__extension__ typedef unsigned long int __ino_t;
79__extension__ typedef __u_quad_t __ino64_t;
80__extension__ typedef unsigned int __mode_t;
81__extension__ typedef unsigned int __nlink_t;
82__extension__ typedef long int __off_t;
83__extension__ typedef __quad_t __off64_t;
84__extension__ typedef int __pid_t;
85__extension__ typedef struct { int __val[2]; } __fsid_t;
86__extension__ typedef long int __clock_t;
87__extension__ typedef unsigned long int __rlim_t;
88__extension__ typedef __u_quad_t __rlim64_t;
89__extension__ typedef unsigned int __id_t;
90__extension__ typedef long int __time_t;
91__extension__ typedef unsigned int __useconds_t;
92__extension__ typedef long int __suseconds_t;
93
94__extension__ typedef int __daddr_t;
95__extension__ typedef long int __swblk_t;
96__extension__ typedef int __key_t;
97
98
99__extension__ typedef int __clockid_t;
100
101
102__extension__ typedef void * __timer_t;
103
104
105__extension__ typedef long int __blksize_t;
106
107
108
109
110__extension__ typedef long int __blkcnt_t;
111__extension__ typedef __quad_t __blkcnt64_t;
112
113
114__extension__ typedef unsigned long int __fsblkcnt_t;
115__extension__ typedef __u_quad_t __fsblkcnt64_t;
116
117
118__extension__ typedef unsigned long int __fsfilcnt_t;
119__extension__ typedef __u_quad_t __fsfilcnt64_t;
120
121__extension__ typedef long int __ssize_t;
122
123
124
125typedef __off64_t __loff_t;
126typedef __quad_t *__qaddr_t;
127typedef char *__caddr_t;
128
129
130__extension__ typedef int __intptr_t;
131
132
133__extension__ typedef unsigned int __socklen_t;
134
135
136
137
138
139typedef __kernel_ipc_pid_t __ipc_pid_t;
140
141
142
143struct __sched_param
144 {
145 int __sched_priority;
146 };
147
148
149struct _pthread_fastlock
150{
151 long int __status;
152 int __spinlock;
153
154};
155
156
157
158typedef struct _pthread_descr_struct *_pthread_descr;
159
160
161
162
163
164typedef struct __pthread_attr_s
165{
166 int __detachstate;
167 int __schedpolicy;
168 struct __sched_param __schedparam;
169 int __inheritsched;
170 int __scope;
171 size_t __guardsize;
172 int __stackaddr_set;
173 void *__stackaddr;
174 size_t __stacksize;
175} pthread_attr_t;
176
177
178
179typedef struct
180{
181 struct _pthread_fastlock __c_lock;
182 _pthread_descr __c_waiting;
183} pthread_cond_t;
184
185
186
187typedef struct
188{
189 int __dummy;
190} pthread_condattr_t;
191
192
193typedef unsigned int pthread_key_t;
194
195
196
197
198
199typedef struct
200{
201 int __m_reserved;
202 int __m_count;
203 _pthread_descr __m_owner;
204 int __m_kind;
205 struct _pthread_fastlock __m_lock;
206} pthread_mutex_t;
207
208
209
210typedef struct
211{
212 int __mutexkind;
213} pthread_mutexattr_t;
214
215
216
217typedef int pthread_once_t;
218typedef unsigned long int pthread_t;
219
220
221
222
223
224
225
226
227
228typedef struct __STDIO_FILE_STRUCT FILE;
229
230
231
232
233
234typedef struct __STDIO_FILE_STRUCT __FILE;
235struct timespec
236 {
237 __time_t tv_sec;
238 long int tv_nsec;
239 };
240
241
242struct sched_param
243 {
244 int __sched_priority;
245 };
246
247
248
249
250
251extern int clone (int (*__fn) (void *__arg), void *__child_stack,
252 int __flags, void *__arg, ...) __attribute__ ((__nothrow__));
253
254
255
256
257
258
259
260
261typedef unsigned long int __cpu_mask;
262
263
264
265
266
267
268typedef struct
269{
270 __cpu_mask __bits[1024 / (8 * sizeof (__cpu_mask))];
271} cpu_set_t;
272
273
274
275
276
277
278
279extern int sched_setparam (__pid_t __pid, __const struct sched_param *__param)
280 __attribute__ ((__nothrow__));
281
282
283extern int sched_getparam (__pid_t __pid, struct sched_param *__param) __attribute__ ((__nothrow__));
284
285
286extern int sched_setscheduler (__pid_t __pid, int __policy,
287 __const struct sched_param *__param) __attribute__ ((__nothrow__));
288
289
290extern int sched_getscheduler (__pid_t __pid) __attribute__ ((__nothrow__));
291
292
293extern int sched_yield (void) __attribute__ ((__nothrow__));
294
295
296extern int sched_get_priority_max (int __algorithm) __attribute__ ((__nothrow__));
297
298
299extern int sched_get_priority_min (int __algorithm) __attribute__ ((__nothrow__));
300
301
302extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) __attribute__ ((__nothrow__));
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317typedef __clock_t clock_t;
318
319
320
321
322
323typedef __time_t time_t;
324
325
326
327typedef __clockid_t clockid_t;
328typedef __timer_t timer_t;
329
330
331struct tm
332{
333 int tm_sec;
334 int tm_min;
335 int tm_hour;
336 int tm_mday;
337 int tm_mon;
338 int tm_year;
339 int tm_wday;
340 int tm_yday;
341 int tm_isdst;
342
343
344
345 long int tm_gmtoff;
346 __const char *tm_zone;
347
348
349
350
351
352};
353
354
355
356
357
358
359
360
361struct itimerspec
362 {
363 struct timespec it_interval;
364 struct timespec it_value;
365 };
366
367
368struct sigevent;
369
370
371
372extern clock_t clock (void) __attribute__ ((__nothrow__));
373
374
375extern time_t time (time_t *__timer) __attribute__ ((__nothrow__));
376
377
378
379extern double difftime (time_t __time1, time_t __time0)
380 __attribute__ ((__nothrow__)) __attribute__ ((__const__));
381
382
383
384extern time_t mktime (struct tm *__tp) __attribute__ ((__nothrow__));
385
386
387
388
389
390extern size_t strftime (char *__restrict __s, size_t __maxsize,
391 __const char *__restrict __format,
392 __const struct tm *__restrict __tp) __attribute__ ((__nothrow__));
393
394
395
396
397extern struct tm *gmtime (__const time_t *__timer) __attribute__ ((__nothrow__));
398
399
400
401extern struct tm *localtime (__const time_t *__timer) __attribute__ ((__nothrow__));
402
403
404
405
406
407extern struct tm *gmtime_r (__const time_t *__restrict __timer,
408 struct tm *__restrict __tp) __attribute__ ((__nothrow__));
409
410
411
412extern struct tm *localtime_r (__const time_t *__restrict __timer,
413 struct tm *__restrict __tp) __attribute__ ((__nothrow__));
414
415
416
417
418
419extern char *asctime (__const struct tm *__tp) __attribute__ ((__nothrow__));
420
421
422extern char *ctime (__const time_t *__timer) __attribute__ ((__nothrow__));
423
424
425
426
427
428
429
430extern char *asctime_r (__const struct tm *__restrict __tp,
431 char *__restrict __buf) __attribute__ ((__nothrow__));
432
433
434extern char *ctime_r (__const time_t *__restrict __timer,
435 char *__restrict __buf) __attribute__ ((__nothrow__));
436extern char *tzname[2];
437
438
439
440extern void tzset (void) __attribute__ ((__nothrow__));
441
442
443
444extern int daylight;
445extern long int timezone;
446
447
448
449
450
451extern int stime (__const time_t *__when) __attribute__ ((__nothrow__));
452extern time_t timegm (struct tm *__tp) __attribute__ ((__nothrow__));
453
454
455extern time_t timelocal (struct tm *__tp) __attribute__ ((__nothrow__));
456
457
458extern int dysize (int __year) __attribute__ ((__nothrow__)) __attribute__ ((__const__));
459extern int nanosleep (__const struct timespec *__requested_time,
460 struct timespec *__remaining);
461
462
463
464extern int clock_getres (clockid_t __clock_id, struct timespec *__res) __attribute__ ((__nothrow__));
465
466
467extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) __attribute__ ((__nothrow__));
468
469
470extern int clock_settime (clockid_t __clock_id, __const struct timespec *__tp)
471 __attribute__ ((__nothrow__));
472extern int timer_create (clockid_t __clock_id,
473 struct sigevent *__restrict __evp,
474 timer_t *__restrict __timerid) __attribute__ ((__nothrow__));
475
476
477extern int timer_delete (timer_t __timerid) __attribute__ ((__nothrow__));
478
479
480extern int timer_settime (timer_t __timerid, int __flags,
481 __const struct itimerspec *__restrict __value,
482 struct itimerspec *__restrict __ovalue) __attribute__ ((__nothrow__));
483
484
485extern int timer_gettime (timer_t __timerid, struct itimerspec *__value)
486 __attribute__ ((__nothrow__));
487
488
489extern int timer_getoverrun (timer_t __timerid) __attribute__ ((__nothrow__));
490
491
492
493
494
495typedef int __sig_atomic_t;
496
497
498
499
500typedef struct
501 {
502 unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
503 } __sigset_t;
504typedef __sigset_t sigset_t;
505
506
507
508
509enum
510{
511 PTHREAD_CREATE_JOINABLE,
512
513 PTHREAD_CREATE_DETACHED
514
515};
516
517enum
518{
519 PTHREAD_INHERIT_SCHED,
520
521 PTHREAD_EXPLICIT_SCHED
522
523};
524
525enum
526{
527 PTHREAD_SCOPE_SYSTEM,
528
529 PTHREAD_SCOPE_PROCESS
530
531};
532
533enum
534{
535 PTHREAD_MUTEX_ADAPTIVE_NP,
536 PTHREAD_MUTEX_RECURSIVE_NP,
537 PTHREAD_MUTEX_ERRORCHECK_NP,
538 PTHREAD_MUTEX_TIMED_NP
539};
540
541enum
542{
543 PTHREAD_PROCESS_PRIVATE,
544
545 PTHREAD_PROCESS_SHARED
546
547};
548struct _pthread_cleanup_buffer
549{
550 void (*__routine) (void *);
551 void *__arg;
552 int __canceltype;
553 struct _pthread_cleanup_buffer *__prev;
554};
555
556
557
558enum
559{
560 PTHREAD_CANCEL_ENABLE,
561
562 PTHREAD_CANCEL_DISABLE
563
564};
565enum
566{
567 PTHREAD_CANCEL_DEFERRED,
568
569 PTHREAD_CANCEL_ASYNCHRONOUS
570
571};
572extern int pthread_create (pthread_t *__restrict __threadp,
573 __const pthread_attr_t *__restrict __attr,
574 void *(*__start_routine) (void *),
575 void *__restrict __arg) __attribute__ ((__nothrow__));
576
577
578extern pthread_t pthread_self (void) __attribute__ ((__nothrow__));
579
580
581extern int pthread_equal (pthread_t __thread1, pthread_t __thread2) __attribute__ ((__nothrow__));
582
583
584extern void pthread_exit (void *__retval) __attribute__ ((__noreturn__));
585
586
587
588
589extern int pthread_join (pthread_t __th, void **__thread_return);
590
591
592
593
594
595extern int pthread_detach (pthread_t __th) __attribute__ ((__nothrow__));
596
597
598
599
600
601
602
603extern int pthread_attr_init (pthread_attr_t *__attr) __attribute__ ((__nothrow__));
604
605
606extern int pthread_attr_destroy (pthread_attr_t *__attr) __attribute__ ((__nothrow__));
607
608
609extern int pthread_attr_setdetachstate (pthread_attr_t *__attr,
610 int __detachstate) __attribute__ ((__nothrow__));
611
612
613extern int pthread_attr_getdetachstate (__const pthread_attr_t *__attr,
614 int *__detachstate) __attribute__ ((__nothrow__));
615
616
617extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr,
618 __const struct sched_param *__restrict
619 __param) __attribute__ ((__nothrow__));
620
621
622extern int pthread_attr_getschedparam (__const pthread_attr_t *__restrict
623 __attr,
624 struct sched_param *__restrict __param)
625 __attribute__ ((__nothrow__));
626
627
628extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, int __policy)
629 __attribute__ ((__nothrow__));
630
631
632extern int pthread_attr_getschedpolicy (__const pthread_attr_t *__restrict
633 __attr, int *__restrict __policy)
634 __attribute__ ((__nothrow__));
635
636
637extern int pthread_attr_setinheritsched (pthread_attr_t *__attr,
638 int __inherit) __attribute__ ((__nothrow__));
639
640
641extern int pthread_attr_getinheritsched (__const pthread_attr_t *__restrict
642 __attr, int *__restrict __inherit)
643 __attribute__ ((__nothrow__));
644
645
646extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope)
647 __attribute__ ((__nothrow__));
648
649
650extern int pthread_attr_getscope (__const pthread_attr_t *__restrict __attr,
651 int *__restrict __scope) __attribute__ ((__nothrow__));
652extern int pthread_attr_setstackaddr (pthread_attr_t *__attr,
653 void *__stackaddr) __attribute__ ((__nothrow__));
654
655
656extern int pthread_attr_getstackaddr (__const pthread_attr_t *__restrict
657 __attr, void **__restrict __stackaddr)
658 __attribute__ ((__nothrow__));
659extern int pthread_attr_setstacksize (pthread_attr_t *__attr,
660 size_t __stacksize) __attribute__ ((__nothrow__));
661
662
663extern int pthread_attr_getstacksize (__const pthread_attr_t *__restrict
664 __attr, size_t *__restrict __stacksize)
665 __attribute__ ((__nothrow__));
666extern int pthread_setschedparam (pthread_t __target_thread, int __policy,
667 __const struct sched_param *__param)
668 __attribute__ ((__nothrow__));
669
670
671extern int pthread_getschedparam (pthread_t __target_thread,
672 int *__restrict __policy,
673 struct sched_param *__restrict __param)
674 __attribute__ ((__nothrow__));
675extern int pthread_mutex_init (pthread_mutex_t *__restrict __mutex,
676 __const pthread_mutexattr_t *__restrict
677 __mutex_attr) __attribute__ ((__nothrow__));
678
679
680extern int pthread_mutex_destroy (pthread_mutex_t *__mutex) __attribute__ ((__nothrow__));
681
682
683extern int pthread_mutex_trylock (pthread_mutex_t *__mutex) __attribute__ ((__nothrow__));
684
685
686extern int pthread_mutex_lock (pthread_mutex_t *__mutex) __attribute__ ((__nothrow__));
687extern int pthread_mutex_unlock (pthread_mutex_t *__mutex) __attribute__ ((__nothrow__));
688
689
690
691
692
693
694extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr) __attribute__ ((__nothrow__));
695
696
697extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr) __attribute__ ((__nothrow__));
698
699
700extern int pthread_mutexattr_getpshared (__const pthread_mutexattr_t *
701 __restrict __attr,
702 int *__restrict __pshared) __attribute__ ((__nothrow__));
703
704
705extern int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr,
706 int __pshared) __attribute__ ((__nothrow__));
707extern int pthread_cond_init (pthread_cond_t *__restrict __cond,
708 __const pthread_condattr_t *__restrict
709 __cond_attr) __attribute__ ((__nothrow__));
710
711
712extern int pthread_cond_destroy (pthread_cond_t *__cond) __attribute__ ((__nothrow__));
713
714
715extern int pthread_cond_signal (pthread_cond_t *__cond) __attribute__ ((__nothrow__));
716
717
718extern int pthread_cond_broadcast (pthread_cond_t *__cond) __attribute__ ((__nothrow__));
719
720
721
722extern int pthread_cond_wait (pthread_cond_t *__restrict __cond,
723 pthread_mutex_t *__restrict __mutex);
724
725
726
727
728
729extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,
730 pthread_mutex_t *__restrict __mutex,
731 __const struct timespec *__restrict
732 __abstime);
733
734
735
736
737extern int pthread_condattr_init (pthread_condattr_t *__attr) __attribute__ ((__nothrow__));
738
739
740extern int pthread_condattr_destroy (pthread_condattr_t *__attr) __attribute__ ((__nothrow__));
741
742
743extern int pthread_condattr_getpshared (__const pthread_condattr_t *
744 __restrict __attr,
745 int *__restrict __pshared) __attribute__ ((__nothrow__));
746
747
748extern int pthread_condattr_setpshared (pthread_condattr_t *__attr,
749 int __pshared) __attribute__ ((__nothrow__));
750extern int pthread_key_create (pthread_key_t *__key,
751 void (*__destr_function) (void *)) __attribute__ ((__nothrow__));
752
753
754extern int pthread_key_delete (pthread_key_t __key) __attribute__ ((__nothrow__));
755
756
757extern int pthread_setspecific (pthread_key_t __key,
758 __const void *__pointer) __attribute__ ((__nothrow__));
759
760
761extern void *pthread_getspecific (pthread_key_t __key) __attribute__ ((__nothrow__));
762extern int pthread_once (pthread_once_t *__once_control,
763 void (*__init_routine) (void));
764
765
766
767
768
769
770extern int pthread_setcancelstate (int __state, int *__oldstate);
771
772
773
774extern int pthread_setcanceltype (int __type, int *__oldtype);
775
776
777extern int pthread_cancel (pthread_t __cancelthread);
778
779
780
781
782extern void pthread_testcancel (void);
783extern void _pthread_cleanup_push (struct _pthread_cleanup_buffer *__buffer,
784 void (*__routine) (void *),
785 void *__arg) __attribute__ ((__nothrow__));
786
787
788
789
790
791
792
793extern void _pthread_cleanup_pop (struct _pthread_cleanup_buffer *__buffer,
794 int __execute) __attribute__ ((__nothrow__));
795extern int pthread_sigmask (int __how,
796 __const __sigset_t *__restrict __newmask,
797 __sigset_t *__restrict __oldmask)__attribute__ ((__nothrow__));
798
799
800extern int pthread_kill (pthread_t __threadid, int __signo) __attribute__ ((__nothrow__));
801extern int pthread_atfork (void (*__prepare) (void),
802 void (*__parent) (void),
803 void (*__child) (void)) __attribute__ ((__nothrow__));
804
805
806
807
808extern void pthread_kill_other_threads_np (void) __attribute__ ((__nothrow__));
809
810
811typedef struct {
812 __off_t __pos;
813
814
815
816
817
818
819} __STDIO_fpos_t;
820
821
822typedef struct {
823 __off64_t __pos;
824
825
826
827
828
829
830} __STDIO_fpos64_t;
831
832
833
834
835typedef __off64_t __offmax_t;
836struct __STDIO_FILE_STRUCT {
837 unsigned short __modeflags;
838
839
840
841
842
843
844
845 unsigned char __ungot[2];
846
847 int __filedes;
848
849 unsigned char *__bufstart;
850 unsigned char *__bufend;
851 unsigned char *__bufpos;
852 unsigned char *__bufread;
853
854
855 unsigned char *__bufgetc_u;
856
857
858 unsigned char *__bufputc_u;
859
860
861
862
863
864 struct __STDIO_FILE_STRUCT *__nextopen;
865 int __user_locking;
866 pthread_mutex_t __lock;
867
868
869
870
871
872};
873extern int __fgetc_unlocked(FILE *__stream);
874extern int __fputc_unlocked(int __c, FILE *__stream);
875extern FILE *__stdin;
876extern FILE *__stdout;
877
878
879
880typedef __builtin_va_list __gnuc_va_list;
881
882
883
884
885typedef __STDIO_fpos_t fpos_t;
886
887
888
889
890
891
892
893extern FILE *stdin;
894extern FILE *stdout;
895extern FILE *stderr;
896
897
898
899
900
901
902
903extern int remove (__const char *__filename) __attribute__ ((__nothrow__));
904
905extern int rename (__const char *__old, __const char *__new) __attribute__ ((__nothrow__));
906
907
908
909
910
911
912
913
914
915extern FILE *tmpfile (void);
916extern char *tmpnam (char *__s) __attribute__ ((__nothrow__));
917
918
919
920
921
922extern char *tmpnam_r (char *__s) __attribute__ ((__nothrow__));
923extern char *tempnam (__const char *__dir, __const char *__pfx)
924 __attribute__ ((__nothrow__)) __attribute__ ((__malloc__));
925
926
927
928
929
930
931
932
933extern int fclose (FILE *__stream);
934
935
936
937
938extern int fflush (FILE *__stream);
939
940extern int fflush_unlocked (FILE *__stream);
941
942
943
944
945
946
947extern FILE *fopen (__const char *__restrict __filename,
948 __const char *__restrict __modes);
949
950
951
952
953extern FILE *freopen (__const char *__restrict __filename,
954 __const char *__restrict __modes,
955 FILE *__restrict __stream);
956
957extern FILE *fdopen (int __fd, __const char *__modes) __attribute__ ((__nothrow__));
958
959
960
961extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__));
962
963
964
965extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
966 int __modes, size_t __n) __attribute__ ((__nothrow__));
967
968
969
970
971
972extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
973 size_t __size) __attribute__ ((__nothrow__));
974
975
976extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__));
977
978
979
980
981
982
983
984
985extern int fprintf (FILE *__restrict __stream,
986 __const char *__restrict __format, ...);
987
988
989
990
991extern int printf (__const char *__restrict __format, ...);
992
993extern int sprintf (char *__restrict __s,
994 __const char *__restrict __format, ...) __attribute__ ((__nothrow__));
995
996
997
998
999
1000extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format,
1001 __gnuc_va_list __arg);
1002
1003
1004
1005
1006extern int vprintf (__const char *__restrict __format, __gnuc_va_list __arg);
1007
1008extern int vsprintf (char *__restrict __s, __const char *__restrict __format,
1009 __gnuc_va_list __arg) __attribute__ ((__nothrow__));
1010
1011
1012
1013
1014
1015extern int snprintf (char *__restrict __s, size_t __maxlen,
1016 __const char *__restrict __format, ...)
1017 __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 4)));
1018
1019extern int vsnprintf (char *__restrict __s, size_t __maxlen,
1020 __const char *__restrict __format, __gnuc_va_list __arg)
1021 __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 0)));
1022
1023
1024
1025
1026
1027
1028extern int fscanf (FILE *__restrict __stream,
1029 __const char *__restrict __format, ...);
1030
1031
1032
1033
1034extern int scanf (__const char *__restrict __format, ...);
1035
1036extern int sscanf (__const char *__restrict __s,
1037 __const char *__restrict __format, ...) __attribute__ ((__nothrow__));
1038
1039
1040
1041
1042
1043
1044extern int fgetc (FILE *__stream);
1045extern int getc (FILE *__stream);
1046
1047
1048
1049
1050
1051extern int getchar (void);
1052
1053extern int getc_unlocked (FILE *__stream);
1054extern int getchar_unlocked (void);
1055extern int fgetc_unlocked (FILE *__stream);
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067extern int fputc (int __c, FILE *__stream);
1068extern int putc (int __c, FILE *__stream);
1069
1070
1071
1072
1073
1074extern int putchar (int __c);
1075
1076extern int fputc_unlocked (int __c, FILE *__stream);
1077
1078
1079
1080
1081
1082
1083
1084extern int putc_unlocked (int __c, FILE *__stream);
1085extern int putchar_unlocked (int __c);
1086extern int getw (FILE *__stream);
1087
1088
1089extern int putw (int __w, FILE *__stream);
1090
1091
1092
1093
1094
1095
1096
1097
1098extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream);
1099
1100
1101
1102
1103
1104
1105extern char *gets (char *__s);
1106
1107
1108
1109
1110
1111
1112extern int fputs (__const char *__restrict __s, FILE *__restrict __stream);
1113
1114
1115
1116
1117
1118extern int puts (__const char *__s);
1119
1120
1121
1122
1123
1124
1125extern int ungetc (int __c, FILE *__stream);
1126
1127
1128
1129
1130
1131
1132extern size_t fread (void *__restrict __ptr, size_t __size,
1133 size_t __n, FILE *__restrict __stream);
1134
1135
1136
1137
1138extern size_t fwrite (__const void *__restrict __ptr, size_t __size,
1139 size_t __n, FILE *__restrict __s);
1140
1141extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
1142 size_t __n, FILE *__restrict __stream);
1143extern size_t fwrite_unlocked (__const void *__restrict __ptr, size_t __size,
1144 size_t __n, FILE *__restrict __stream);
1145
1146
1147
1148
1149
1150
1151
1152
1153extern int fseek (FILE *__stream, long int __off, int __whence);
1154
1155
1156
1157
1158extern long int ftell (FILE *__stream);
1159
1160
1161
1162
1163extern void rewind (FILE *__stream);
1164
1165
1166
1167
1168
1169
1170
1171extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos);
1172
1173
1174
1175
1176extern int fsetpos (FILE *__stream, __const fpos_t *__pos);
1177
1178
1179
1180extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__));
1181
1182extern int feof (FILE *__stream) __attribute__ ((__nothrow__));
1183
1184extern int ferror (FILE *__stream) __attribute__ ((__nothrow__));
1185
1186
1187
1188
1189extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__));
1190extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__));
1191extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__));
1192
1193
1194
1195
1196
1197
1198
1199
1200extern void perror (__const char *__s);
1201
1202extern int fileno (FILE *__stream) __attribute__ ((__nothrow__));
1203
1204
1205
1206
1207extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__));
1208extern FILE *popen (__const char *__command, __const char *__modes);
1209
1210
1211
1212
1213
1214extern int pclose (FILE *__stream);
1215
1216
1217
1218
1219
1220extern char *ctermid (char *__s) __attribute__ ((__nothrow__));
1221extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__));
1222
1223
1224
1225extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__));
1226
1227
1228extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__));
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239extern void *memcpy (void *__restrict __dest,
1240 __const void *__restrict __src, size_t __n)
1241 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1242
1243
1244extern void *memmove (void *__dest, __const void *__src, size_t __n)
1245 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1246
1247
1248
1249
1250
1251
1252extern void *memccpy (void *__restrict __dest, __const void *__restrict __src,
1253 int __c, size_t __n)
1254 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1255
1256
1257
1258
1259
1260extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1261
1262
1263extern int memcmp (__const void *__s1, __const void *__s2, size_t __n)
1264 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
1265
1266
1267extern void *memchr (__const void *__s, int __c, size_t __n)
1268 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
1269
1270
1271
1272extern char *strcpy (char *__restrict __dest, __const char *__restrict __src)
1273 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1274
1275extern char *strncpy (char *__restrict __dest,
1276 __const char *__restrict __src, size_t __n)
1277 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1278
1279
1280extern char *strcat (char *__restrict __dest, __const char *__restrict __src)
1281 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1282
1283extern char *strncat (char *__restrict __dest, __const char *__restrict __src,
1284 size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1285
1286
1287extern int strcmp (__const char *__s1, __const char *__s2)
1288 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
1289
1290extern int strncmp (__const char *__s1, __const char *__s2, size_t __n)
1291 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
1292
1293
1294extern int strcoll (__const char *__s1, __const char *__s2)
1295 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
1296
1297extern size_t strxfrm (char *__restrict __dest,
1298 __const char *__restrict __src, size_t __n)
1299 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
1300
1301extern char *strdup (__const char *__s)
1302 __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
1303
1304
1305extern char *strchr (__const char *__s, int __c)
1306 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
1307
1308extern char *strrchr (__const char *__s, int __c)
1309 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
1310
1311
1312
1313
1314extern size_t strcspn (__const char *__s, __const char *__reject)
1315 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
1316
1317
1318extern size_t strspn (__const char *__s, __const char *__accept)
1319 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
1320
1321extern char *strpbrk (__const char *__s, __const char *__accept)
1322 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
1323
1324extern char *strstr (__const char *__haystack, __const char *__needle)
1325 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
1326
1327
1328
1329extern char *strtok (char *__restrict __s, __const char *__restrict __delim)
1330 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
1331
1332extern char *strtok_r (char *__restrict __s, __const char *__restrict __delim,
1333 char **__restrict __save_ptr)
1334 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3)));
1335
1336
1337extern size_t strlen (__const char *__s)
1338 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
1339
1340
1341
1342extern char *strerror (int __errnum) __attribute__ ((__nothrow__));
1343
1344extern char *__glibc_strerror_r (int __errnum, char *__buf, size_t __buflen)
1345 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
1346
1347extern char * strerror_r (int __errnum, char *__buf, size_t __buflen) __asm__ ("_" "__glibc_strerror_r") __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
1348extern void bcopy (__const void *__src, void *__dest, size_t __n)
1349 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1350
1351
1352extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1353
1354
1355extern int bcmp (__const void *__s1, __const void *__s2, size_t __n)
1356 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
1357
1358
1359extern char *index (__const char *__s, int __c)
1360 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
1361
1362
1363extern char *rindex (__const char *__s, int __c)
1364 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
1365extern int ffs (int __i) __attribute__ ((__nothrow__)) __attribute__ ((__const__));
1366extern int strcasecmp (__const char *__s1, __const char *__s2)
1367 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
1368
1369
1370extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n)
1371 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
1372extern char *strsep (char **__restrict __stringp,
1373 __const char *__restrict __delim)
1374 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1375extern size_t strlcat(char *__restrict dst, const char *__restrict src,
1376 size_t n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1377extern size_t strlcpy(char *__restrict dst, const char *__restrict src,
1378 size_t n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1379
1380
1381
1382
1383
1384
1385const char *it = "<UNSET>";
1386size_t errors = 0;
1387
1388char one[50];
1389char two[50];
1390
1391static void
1392check (int thing, int number)
1393{
1394 if (!thing)
1395 {
1396 printf("%s flunked test %d\n", it, number);
1397 ++errors;
1398 }
1399 else if (0)
1400 {
1401 printf("%s test %d ok\n", it, number);
1402 }
1403}
1404
1405
1406static void
1407equal (const char *a, const char *b, int number)
1408{
1409 check(a != ((void *)0) && b != ((void *)0) && (strcmp((a), (b)) == 0), number);
1410}
1411
1412
1413int _strcmp(const char *cs, const char *ct)
1414{
1415
1416
1417
1418 int __res1, __res2;
1419
1420 __asm__
1421 ("1:\t%2 = B[%0++] (Z);\n\t"
1422 "%3 = B[%1++] (Z);\n\t"
1423 "CC = %2 == %3;\n\t"
1424 "if ! cc jump 2f;\n\t"
1425 "CC = %2;\n\t"
1426 "if cc jump 1b (bp);\n\t"
1427 "jump.s 3f;\n"
1428 "2:\t%2 = %2 - %3;\n"
1429 "3:\n"
1430 : "+&a" (cs), "+&a" (ct), "=&d" (__res1), "=&d" (__res2)
1431 : : "CC");
1432
1433 return __res1;
1434}
1435
1436void
1437test_strcmp (void)
1438{
1439 it = "strcmp";
1440 {
1441 char buf1[0x40], buf2[0x40];
1442 int i, j;
1443
1444j = i = 0;
1445
1446 {
1447 int k;
1448
1449
1450
1451
1452
1453
1454
1455 buf1[i] = buf1[0x3f] = 0;
1456 buf2[j] = buf2[0x3f] = 0;
1457
1458k = 0;
1459 {
1460
1461;
1462;
1463
1464 buf1[i+k] = 'A' + i + k;
1465 buf1[i+k+1] = 0;
1466;
1467;
1468 check (_strcmp (buf1+i,buf2+j) > 0, 2);
1469
1470return;
1471 }
1472 }
1473 }
1474}
1475
1476int main(int argc, char *argv[])
1477{
1478 int status;
1479
1480 test_strcmp ();
1481
1482 if (errors == 0)
1483 {
1484 status = 0;
1485 printf("TEST PASS.\n");
1486 }
1487 else
1488 {
1489 status = 1;
1490 printf("%Zd errors.\n", errors);
1491 printf("TEST FAIL.\n");
1492 }
1493
1494 return status;
1495}