3 /* ------------------------------------------------------- */
4 #if defined test_backtrace_1
8 printf("* f3()\n"), fflush(stdout
);
13 printf("* f2()\n"), fflush(stdout
);
18 printf("* f1()\n"), fflush(stdout
);
21 int main(int argc
, char **argv
)
23 printf("* main\n"), fflush(stdout
);
25 printf("* exit main\n"), fflush(stdout
);
29 /* ------------------------------------------------------- */
30 #elif defined test_bcheck_1
32 struct s
{ int a
,b
,c
,d
,e
; };
37 printf("* f1()\n"), fflush(stdout
);
40 int main(int argc
, char **argv
)
42 printf("* main\n"), fflush(stdout
);
44 printf("* exit main\n"), fflush(stdout
);
48 /* ------------------------------------------------------- */
49 #elif defined test_tcc_backtrace_2
51 /* test custom backtrace and 'exit()' redirection */
52 int tcc_backtrace(const char *fmt
, ...);
58 printf("* exit f2\n"), fflush(stdout
);
63 printf("* f1()\n"), fflush(stdout
);
64 tcc_backtrace("Hello from %s!", "f1");
67 int main(int argc
, char **argv
)
69 printf("* main\n"), fflush(stdout
);
71 printf("* exit main\n"), fflush(stdout
);
75 /* ------------------------------------------------------- */
76 #elif defined test_tcc_backtrace_3
78 /* this test should be run despite of the exit(34) above */
79 int main(int argc
, char **argv
)
81 printf("* main\n"), fflush(stdout
);
85 /* ------------------------------------------------------- */
97 memset (pad1
, 0, sizeof(pad1
));
98 memset (pad2
, 0, sizeof(pad2
));
99 memset (pad3
, 0, sizeof(pad3
));
106 #if defined test_bcheck_100
107 memcpy(&a
[1],&b
[0],10);
108 #elif defined test_bcheck_101
109 memcpy(&a
[0],&b
[1],10);
110 #elif defined test_bcheck_102
111 memcpy(&a
[0],&a
[3],4);
112 #elif defined test_bcheck_103
113 memcpy(&a
[3],&a
[0],4);
114 #elif defined test_bcheck_104
115 memcmp(&b
[1],&b
[0],10);
116 #elif defined test_bcheck_105
117 memcmp(&b
[0],&b
[1],10);
118 #elif defined test_bcheck_106
119 memmove(&b
[1],&b
[0],10);
120 #elif defined test_bcheck_107
121 memmove(&b
[0],&b
[1],10);
122 #elif defined test_bcheck_108
123 memset(&b
[1],'b',10);
124 #elif defined test_bcheck_109
126 #elif defined test_bcheck_110
127 strcpy(&a
[7], &a
[0]);
128 #elif defined test_bcheck_111
129 strcpy(&a
[0], &b
[7]);
130 #elif defined test_bcheck_112
131 strcpy(&a
[0], &a
[1]);
132 #elif defined test_bcheck_113
133 strcpy(&a
[2], &a
[0]);
134 #elif defined test_bcheck_114
135 strncpy(&a
[7], &a
[0], 10);
136 #elif defined test_bcheck_115
137 strncpy(&a
[0], &b
[7], 10);
138 #elif defined test_bcheck_116
139 strncpy(&a
[0], &a
[1], 10);
140 #elif defined test_bcheck_117
141 strncpy(&a
[2], &a
[0], 10);
142 #elif defined test_bcheck_118
143 strcmp(&b
[2], &b
[0]);
144 #elif defined test_bcheck_119
145 strcmp(&b
[0], &b
[2]);
146 #elif defined test_bcheck_120
147 strncmp(&b
[5], &b
[0], 10);
148 #elif defined test_bcheck_121
149 strncmp(&b
[0], &b
[5], 10);
150 #elif defined test_bcheck_122
151 strcat(&a
[7], &a
[0]);
152 #elif defined test_bcheck_123
153 strcat(&a
[0], &b
[3]);
154 #elif defined test_bcheck_124
155 strcat(&a
[0], &a
[4]);
156 #elif defined test_bcheck_125
157 strcat(&a
[3], &a
[0]);
158 #elif defined test_bcheck_126
160 #elif defined test_bcheck_127
164 /* ------------------------------------------------------- */