Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify -pedantic %s |
Andy Gibbs | 8e8fb3b | 2012-10-19 12:44:48 +0000 | [diff] [blame] | 2 | // expected-no-diagnostics |
Eli Friedman | bc4e29f | 2009-06-01 09:24:59 +0000 | [diff] [blame] | 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 |