Eli Friedman | bc4e29f | 2009-06-01 09:24:59 +0000 | [diff] [blame] | 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 |