| | 1 | #line 1 "ifdef.c" |
| | 2 | |
| | 3 | |
| | 4 | |
| | 5 | |
| | 6 | |
| | 7 | |
| | 8 | |
| | 9 | |
| | 10 | |
| | 11 | |
| | 12 | |
| | 13 | |
| | 14 | |
| | 15 | |
| | 16 | |
| | 17 | |
| | 18 | |
| | 19 | |
| | 20 | |
| | 21 | "AAA -> yes - ok"; |
| | 22 | |
| | 23 | |
| | 24 | |
| | 25 | |
| | 26 | |
| | 27 | |
| | 28 | |
| | 29 | |
| | 30 | |
| | 31 | "AAA -> no - ok"; |
| | 32 | |
| | 33 | |
| | 34 | |
| | 35 | |
| | 36 | |
| | 37 | |
| | 38 | "good ?:"; |
| | 39 | |
| | 40 | |
| | 41 | |
| | 42 | "good ?:"; |
| | 43 | |
| | 44 | |
| | 45 | |
| | 46 | |
| | 47 | |
| | 48 | printf('abc' + '= %d\n', abc); |
| | 49 | printf('def_' + '= %d\n', def_); |
| | 50 | |
| | 51 | |
| | 52 | "printval is defined!"; |
| | 53 | |
| | 54 | |
| | 55 | |
| | 56 | |
| | 57 | |
| | 58 | |
| | 59 | |
| | 60 | "okay!!!"; |
| | 61 | |
| | 62 | |
| | 63 | |
| | 64 | |
| | 65 | |
| | 66 | |
| | 67 | "try string translations"; |
| | 68 | |
| | 69 | #pragma message("u > 7 - ok") |
| | 70 | |
| | 71 | |
| | 72 | |
| | 73 | |
| | 74 | |
| | 75 | #pragma message("\\u00C7 > aaaa - ok") |
| | 76 | |
| | 77 | |
| | 78 | |
| | 79 | |
| | 80 | |
| | 81 | #pragma message("\\uC7 > \\xC6 - ok") |
| | 82 | |
| | 83 | |
| | 84 | |
| | 85 | |
| | 86 | "pragma message with a translation"; |
| | 87 | |
| | 88 | #pragma message("this is a test message") |
| | 89 | #error "macro: " "this is a test message" "!!!" |
| | 90 | |
| | 91 | |
| | 92 | "try some macros with arguments"; |
| | 93 | |
| | 94 | |
| | 95 | |
| | 96 | |
| | 97 | "testing product(10, 20): "; ((10) * (20)); |
| | 98 | "testing product(sum(10, sum3(1, 2, 3)), product(5, 10)): "; |
| | 99 | ((((10) + (((1) + (2) + (3))))) * (((5) * (10)))); |
| | 100 | |
| | 101 | "testing sum(sum(sum(1, 2), sum(3, 4)), sum(sum(5, 6), sum(7, 8))): "; |
| | 102 | ((((((1) + (2))) + (((3) + (4))))) + (((((5) + (6))) + (((7) + (8)))))); |
| | 103 | |
| | 104 | |
| | 105 | |
| | 106 | "circular_a(100): "; CIRCULAR_A(100*A*B); |
| | 107 | "circular_a(circular_b(50)): "; CIRCULAR_A(CIRCULAR_B(50*B*A)*A*B); |
| | 108 | |
| | 109 | |
| | 110 | "good argument expansion"; |
| | 111 | |
| | 112 | |
| | 113 | |
| | 114 | |
| | 115 | |
| | 116 | |
| | 117 | |
| | 118 | "good expansion"; |
| | 119 | |
| | 120 | |
| | 121 | |
| | 122 | |
| | 123 | |
| | 124 | "try some #if's with macro expansions"; |
| | 125 | |
| | 126 | |
| | 127 | |
| | 128 | |
| | 129 | |
| | 130 | |
| | 131 | |
| | 132 | |
| | 133 | "good elif with expansion!!!"; |
| | 134 | |
| | 135 | |
| | 136 | |
| | 137 | |
| | 138 | |
| | 139 | |
| | 140 | |
| | 141 | |
| | 142 | |
| | 143 | "good string #if"; |
| | 144 | |
| | 145 | |
| | 146 | |
| | 147 | |
| | 148 | |
| | 149 | "good string #else"; |
| | 150 | |
| | 151 | |
| | 152 | |
| | 153 | |
| | 154 | |
| | 155 | "good string #elif"; |
| | 156 | |
| | 157 | |
| | 158 | "try some #if's with constant expressions" |
| | 159 | |
| | 160 | |
| | 161 | |
| | 162 | "good if!!!" |
| | 163 | |
| | 164 | |
| | 165 | |
| | 166 | |
| | 167 | |
| | 168 | "good if!!! (and a tough one, too)"; |
| | 169 | |
| | 170 | |
| | 171 | |
| | 172 | |
| | 173 | |
| | 174 | |
| | 175 | |
| | 176 | |
| | 177 | |
| | 178 | |
| | 179 | |
| | 180 | |
| | 181 | |
| | 182 | "good elif!!!!!!" |
| | 183 | |
| | 184 | |
| | 185 | |
| | 186 | |
| | 187 | |
| | 188 | |
| | 189 | |
| | 190 | |
| | 191 | |
| | 192 | "done with if/elif"; |
| | 193 | |
| | 194 | "define some macros"; |
| | 195 | |
| | 196 | |
| | 197 | |
| | 198 | "try out a positive #if"; |
| | 199 | |
| | 200 | "this is a good #if"; |
| | 201 | |
| | 202 | |
| | 203 | |
| | 204 | "end of positive #if"; |
| | 205 | |
| | 206 | "try a negative #if"; |
| | 207 | |
| | 208 | |
| | 209 | |
| | 210 | "this is a good #else"; |
| | 211 | |
| | 212 | "end of negative #if"; |
| | 213 | |
| | 214 | "try some nested #if's"; |
| | 215 | |
| | 216 | "good #if - level 1"; A |
| | 217 | |
| | 218 | "good #if - level 2"; B |
| | 219 | |
| | 220 | |
| | 221 | |
| | 222 | "good #else - level 3"; D |
| | 223 | |
| | 224 | "good #if - level 2"; E |
| | 225 | |
| | 226 | |
| | 227 | |
| | 228 | |
| | 229 | |
| | 230 | |
| | 231 | |
| | 232 | |
| | 233 | "good #if - level 1"; I |
| | 234 | |
| | 235 | |
| | 236 | |
| | 237 | |
| | 238 | |
| | 239 | |
| | 240 | |
| | 241 | |
| | 242 | |
| | 243 | |
| | 244 | |
| | 245 | |
| | 246 | |
| | 247 | |
| | 248 | |
| | 249 | |
| | 250 | |
| | 251 | |
| | 252 | |
| | 253 | |
| | 254 | "good again"; |
| | 255 | |
| | 256 | |
| | 257 | |
| | 258 | "done with nested #if's"; |
| | 259 | |
| | 260 | "ifndef test"; |
| | 261 | |
| | 262 | |
| | 263 | |
| | 264 | "good ifndef else"; |
| | 265 | |
| | 266 | |
| | 267 | "good ifndef"; |
| | 268 | |
| | 269 | |
| | 270 | |
| | 271 | |
| | 272 | |
| | 273 | |
| | 274 | |
| | 275 | |
| | 276 | |
| | 277 | |
| | 278 | |
| | 279 | |
| | 280 | |
| | 281 | |
| | 282 | |
| | 283 | |
| | 284 | |
| | 285 | |
| | 286 | |
| | 287 | |
| | 288 | |
| | 289 | |
| | 290 | |
| | 291 | |
| | 292 | |
| | 293 | |
| | 294 | |
| | 295 | |
| | 296 | |
| | 297 | #line 1 "header.t" |
| | 298 | >>header line 1<< |
| | 299 | |
| | 300 | |
| | 301 | |
| | 302 | |
| | 303 | |
| | 304 | |
| | 305 | |
| | 306 | |
| | 307 | |
| | 308 | |
| | 309 | |
| | 310 | |
| | 311 | 'We\'re inside the header now!!!'; |
| | 312 | |
| | 313 | "here's an unterminated #if..."; |
| | 314 | |
| | 315 | |
| | 316 | |
| | 317 | #line 1 "header2.t" |
| | 318 | |
| | 319 | |
| | 320 | |
| | 321 | |
| | 322 | |
| | 323 | header2.t(6): error: #elif without #if |
| | 324 | |
| | 325 | |
| | 326 | hmm.... hmm.... hmm.... |
| | 327 | |
| | 328 | header2.t(10): error: #else without #if |
| | 329 | |
| | 330 | |
| | 331 | yada, yada, yada... |
| | 332 | |
| | 333 | header2.t(14): error: #endif without #if |
| | 334 | |
| | 335 | |
| | 336 | |
| | 337 | #line 20 "header.t" |
| | 338 | |
| | 339 | "__LINE__ and __FILE__ in the header: " 'header.t', 21; |
| | 340 | |
| | 341 | "That's it for the header."; |
| | 342 | >>header end<< |
| | 343 | header.t(25): error: #if without #endif (line 17, file header.t) |
| | 344 | #line 296 "ifdef.c" |
| | 345 | |
| | 346 | "This is a string. The #include below should be ignored, because it's part of the string. #include " |
| | 347 | #line 300 "ifdef.c" |
| | 348 | badfile.t" That's that!" |
| | 349 | #line 302 "ifdef.c" |
| | 350 | ; |
| | 351 | |
| | 352 | "This is a string with escaped \"quote marks\". Those quotes shouldn't end the string. \"the next #include should be ignored, since it's
still part of the string: #include <badfile.t> That's all for the string!" |
| | 353 | #line 310 "ifdef.c" |
| | 354 | ; |
| | 355 | |
| | 356 | |
| | 357 | |
| | 358 | |
| | 359 | |
| | 360 | "Here's a string with a /*comment*/ embedded."; |
| | 361 | |
| | 362 | "Here's some mixing:" "String" "Done!!!" |
| | 363 | |
| | 364 | |
| | 365 | |
| | 366 | |
| | 367 | |
| | 368 | |
| | 369 | ifdef.c(325): warning: extraneous characters following #include filename |
| | 370 | |
| | 371 | #line 1 "header.t" |
| | 372 | >>header line 1<< |
| | 373 | |
| | 374 | |
| | 375 | |
| | 376 | |
| | 377 | |
| | 378 | |
| | 379 | |
| | 380 | |
| | 381 | |
| | 382 | |
| | 383 | |
| | 384 | |
| | 385 | 'We\'re inside the header now!!!'; |
| | 386 | |
| | 387 | "here's an unterminated #if..."; |
| | 388 | |
| | 389 | |
| | 390 | |
| | 391 | #line 1 "header2.t" |
| | 392 | |
| | 393 | |
| | 394 | |
| | 395 | |
| | 396 | |
| | 397 | header2.t(6): error: #elif without #if |
| | 398 | |
| | 399 | |
| | 400 | hmm.... hmm.... hmm.... |
| | 401 | |
| | 402 | header2.t(10): error: #else without #if |
| | 403 | |
| | 404 | |
| | 405 | yada, yada, yada... |
| | 406 | |
| | 407 | header2.t(14): error: #endif without #if |
| | 408 | |
| | 409 | |
| | 410 | |
| | 411 | #line 20 "header.t" |
| | 412 | |
| | 413 | "__LINE__ and __FILE__ in the header: " 'header.t', 21; |
| | 414 | |
| | 415 | "That's it for the header."; |
| | 416 | >>header end<< |
| | 417 | header.t(25): error: #if without #endif (line 17, file header.t) |
| | 418 | #line 329 "ifdef.c" |
| | 419 | |
| | 420 | "That's it!"; |
| | 421 | |
| | 422 | |
| | 423 | #line 1 "header.t" |
| | 424 | >>header line 1<< |
| | 425 | |
| | 426 | |
| | 427 | |
| | 428 | |
| | 429 | |
| | 430 | |
| | 431 | |
| | 432 | |
| | 433 | |
| | 434 | |
| | 435 | |
| | 436 | |
| | 437 | 'We\'re inside the header now!!!'; |
| | 438 | |
| | 439 | "here's an unterminated #if..."; |
| | 440 | |
| | 441 | |
| | 442 | |
| | 443 | #line 1 "header2.t" |
| | 444 | |
| | 445 | |
| | 446 | |
| | 447 | |
| | 448 | |
| | 449 | header2.t(6): error: #elif without #if |
| | 450 | |
| | 451 | |
| | 452 | hmm.... hmm.... hmm.... |
| | 453 | |
| | 454 | header2.t(10): error: #else without #if |
| | 455 | |
| | 456 | |
| | 457 | yada, yada, yada... |
| | 458 | |
| | 459 | header2.t(14): error: #endif without #if |
| | 460 | |
| | 461 | |
| | 462 | |
| | 463 | #line 20 "header.t" |
| | 464 | |
| | 465 | "__LINE__ and __FILE__ in the header: " 'header.t', 21; |
| | 466 | |
| | 467 | "That's it for the header."; |
| | 468 | >>header end<< |
| | 469 | header.t(25): error: #if without #endif (line 17, file header.t) |
| | 470 | #line 333 "ifdef.c" |
| | 471 | Line directly after the header! |
| | 472 | |
| | 473 | |
| | 474 | "Try some random #line directives!"; |
| | 475 | |
| | 476 | |
| | 477 | #line 1234 "foo_test.c" |
| | 478 | |
| | 479 | hello! |
| | 480 | |
| | 481 | |
| | 482 | #line 6789 "test2.c" |
| | 483 | |
| | 484 | goodbye! |
| | 485 | |
| | 486 | |
| | 487 | #line 6 "foo_test.c" |
| | 488 | |
| | 489 | "__LINE__ and __FILE__ near the end of file: "; 7, 'foo_test.c'; |
| | 490 | |
| | 491 | "Make sure we come back here after we're done with an include file."; |
| | 492 | |
| | 493 | #line 1 "header.t" |
| | 494 | >>header line 1<< |
| | 495 | |
| | 496 | |
| | 497 | |
| | 498 | |
| | 499 | |
| | 500 | |
| | 501 | |
| | 502 | |
| | 503 | |
| | 504 | |
| | 505 | |
| | 506 | |
| | 507 | 'We\'re inside the header now!!!'; |
| | 508 | |
| | 509 | "here's an unterminated #if..."; |
| | 510 | |
| | 511 | |
| | 512 | |
| | 513 | #line 1 "header2.t" |
| | 514 | |
| | 515 | |
| | 516 | |
| | 517 | |
| | 518 | |
| | 519 | header2.t(6): error: #elif without #if |
| | 520 | |
| | 521 | |
| | 522 | hmm.... hmm.... hmm.... |
| | 523 | |
| | 524 | header2.t(10): error: #else without #if |
| | 525 | |
| | 526 | |
| | 527 | yada, yada, yada... |
| | 528 | |
| | 529 | header2.t(14): error: #endif without #if |
| | 530 | |
| | 531 | |
| | 532 | |
| | 533 | #line 20 "header.t" |
| | 534 | |
| | 535 | "__LINE__ and __FILE__ in the header: " 'header.t', 21; |
| | 536 | |
| | 537 | "That's it for the header."; |
| | 538 | >>header end<< |
| | 539 | header.t(25): error: #if without #endif (line 17, file header.t) |
| | 540 | #line 11 "foo_test.c" |
| | 541 | >>> back from include!!! <<< |
| | 542 | |
| | 543 | |
| | 544 | "Try expanding macros and calculating values in #line"; |
| | 545 | |
| | 546 | #line 205 "test.h" |
| | 547 | |
| | 548 | "try __FILE__ and __LINE__"; |
| | 549 | "__FILE__: <<'test.h'>>, __LINE__: << 207 >>\n"; |
| | 550 | |
| | 551 | "__FILE__: << |
| | 552 | 'test.h' |
| | 553 | >>, __LINE__: << |
| | 554 | #line 213 "test.h" |
| | 555 | 213 >> -- that was __FILE and __LINE!\n"; |
| | 556 | |
| | 557 | hash table: total 30, longest 2, average 0 |
| | 558 | number of buckets over average length: 28 |
| | 559 | number of empty buckets: 484 |
| | 560 | |
| | 561 | (T3VM) Memory blocks still in use: |
| | 562 | |
| | 563 | Total blocks in use: 0 |