Last change
on this file since 467 was
444,
checked in by satin@…, 6 years ago
|
add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc
|
File size:
829 bytes
|
Rev | Line | |
---|
[444] | 1 | /* Oki bug report [OKI013] |
---|
| 2 | |
---|
| 3 | Variable argments test failed. |
---|
| 4 | |
---|
| 5 | Execution result. |
---|
| 6 | val1, val2 = 1, 0 |
---|
| 7 | val1, val2 = 2, 0 |
---|
| 8 | val1, val2 = 3, 0 |
---|
| 9 | |
---|
| 10 | Note, this test case for for traditional style C code. |
---|
| 11 | |
---|
| 12 | */ |
---|
| 13 | |
---|
| 14 | #include <stdio.h> |
---|
| 15 | #include <varargs.h> |
---|
| 16 | int func(); |
---|
| 17 | |
---|
| 18 | main() |
---|
| 19 | { |
---|
| 20 | func(1., 2., 3.); |
---|
| 21 | } |
---|
| 22 | |
---|
| 23 | func(va_alist) |
---|
| 24 | va_dcl |
---|
| 25 | { |
---|
| 26 | va_list p; |
---|
| 27 | double val1, val2; |
---|
| 28 | int j; |
---|
| 29 | |
---|
| 30 | va_start(p); |
---|
| 31 | for (j = 1; j <= 3; ++j){ |
---|
| 32 | dequals((double)j, va_arg(p, double)); |
---|
| 33 | } |
---|
| 34 | va_end(p); |
---|
| 35 | return (p); |
---|
| 36 | } |
---|
| 37 | |
---|
| 38 | dequals(double val1, double val2) |
---|
| 39 | { |
---|
| 40 | iprintf ("val1 is %d, val2 is %d\n", (int)val1, (int)val2); |
---|
| 41 | if (val1 == val2) |
---|
| 42 | pass ("varargs2 [OKI013]"); |
---|
| 43 | else |
---|
| 44 | fail ("varargs2 [OKI013]"); |
---|
| 45 | |
---|
| 46 | fflush (stdout); |
---|
| 47 | return; |
---|
| 48 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.