]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/Sema/knr-variadic-def.c
Import Clang, at r72732.
[FreeBSD/FreeBSD.git] / test / Sema / knr-variadic-def.c
1 // RUN: clang-cc -fsyntax-only -verify -pedantic %s
2 // PR4287
3
4 #include <stdarg.h>
5 char *foo = "test";
6 int test(char*,...);
7
8 int test(fmt)
9         char*fmt;
10 {
11         va_list ap;
12         char*a;
13         int x;
14
15         va_start(ap,fmt);
16         a=va_arg(ap,char*);
17         x=(a!=foo);
18         va_end(ap);
19         return x;
20 }
21
22 void exit();
23
24 int main(argc,argv)
25         int argc;char**argv;
26 {
27         exit(test("",foo));
28 }
29