* execute/va-arg-13.c: New test.

From-SVN: r32127
This commit is contained in:
Franz Sirl 2000-02-23 23:16:36 +00:00 committed by Franz Sirl
parent 8706d596ac
commit 1e59bcc307
2 changed files with 42 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2000-02-23 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
* execute/va-arg-13.c: New test.
Wed Feb 23 14:16:06 2000 Donald Lindsay <dlindsay@cygnus.com>
* execute/va-arg-12.c: New test.

View File

@ -0,0 +1,38 @@
/* derived from mozilla source code */
#include <stdarg.h>
typedef struct {
void *stream;
va_list ap;
int nChar;
} ScanfState;
void dummy (va_list vap)
{
if (va_arg (vap, int) != 1234) abort();
return;
}
void test (int fmt, ...)
{
ScanfState state, *statep;
statep = &state;
va_start (statep->ap, fmt);
dummy (statep->ap);
va_end (statep->ap);
va_start (state.ap, fmt);
dummy (state.ap);
va_end (state.ap);
return;
}
int main (void)
{
test (456, 1234);
exit (0);
}