2009-12-16 04:14:24 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify -pedantic %s
|
2012-10-19 20:44:48 +08:00
|
|
|
// expected-no-diagnostics
|
2009-06-01 17:24:59 +08:00
|
|
|
// PR4287
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
char *foo = "test";
|
|
|
|
int test(char*,...);
|
|
|
|
|
|
|
|
int test(fmt)
|
|
|
|
char*fmt;
|
|
|
|
{
|
|
|
|
va_list ap;
|
|
|
|
char*a;
|
|
|
|
int x;
|
|
|
|
|
|
|
|
va_start(ap,fmt);
|
|
|
|
a=va_arg(ap,char*);
|
|
|
|
x=(a!=foo);
|
|
|
|
va_end(ap);
|
|
|
|
return x;
|
|
|
|
}
|
|
|
|
|
|
|
|
void exit();
|
|
|
|
|
|
|
|
int main(argc,argv)
|
|
|
|
int argc;char**argv;
|
|
|
|
{
|
|
|
|
exit(test("",foo));
|
|
|
|
}
|
|
|
|
|