mirror of
https://gcc.gnu.org/git/gcc.git
synced 2025-01-02 00:43:44 +08:00
* execute/va-arg-13.c: New test.
From-SVN: r32127
This commit is contained in:
parent
8706d596ac
commit
1e59bcc307
@ -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.
|
||||
|
38
gcc/testsuite/gcc.c-torture/execute/va-arg-13.c
Normal file
38
gcc/testsuite/gcc.c-torture/execute/va-arg-13.c
Normal 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);
|
||||
}
|
Loading…
Reference in New Issue
Block a user