Home | History | Annotate | Download | only in Sema
      1 // RUN: %clang_cc1 -fsyntax-only -verify -pedantic %s
      2 // expected-no-diagnostics
      3 // PR4287
      4 
      5 #include <stdarg.h>
      6 char *foo = "test";
      7 int test(char*,...);
      8 
      9 int test(fmt)
     10         char*fmt;
     11 {
     12         va_list ap;
     13         char*a;
     14         int x;
     15 
     16         va_start(ap,fmt);
     17         a=va_arg(ap,char*);
     18         x=(a!=foo);
     19         va_end(ap);
     20         return x;
     21 }
     22 
     23 void exit();
     24 
     25 int main(argc,argv)
     26         int argc;char**argv;
     27 {
     28         exit(test("",foo));
     29 }
     30 
     31