Douglas Gregor | ef5cc75 | 2009-04-02 04:59:27 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -fsyntax-only -pedantic -fixit %s -o - | clang-cc -pedantic -Werror -x c - |
Douglas Gregor | 9b3064b | 2009-04-01 22:41:11 +0000 | [diff] [blame] | 2 | |
| 3 | /* This is a test of the various code modification hints that are |
Douglas Gregor | fe057ac | 2009-04-02 03:20:30 +0000 | [diff] [blame] | 4 | provided as part of warning or extension diagnostics. All of the |
| 5 | warnings will be fixed by -fixit, and the resulting file should |
| 6 | compile cleanly with -Werror -pedantic. */ |
Douglas Gregor | a86b832 | 2009-04-06 18:45:53 +0000 | [diff] [blame] | 7 | #include <string.h> // FIXME: FIX-IT hint should add this for us! |
Douglas Gregor | 9b3064b | 2009-04-01 22:41:11 +0000 | [diff] [blame] | 8 | |
| 9 | void f0(void) { }; |
| 10 | |
| 11 | struct s { |
| 12 | int x, y;; |
| 13 | }; |
| 14 | |
| 15 | _Complex cd; |
| 16 | |
| 17 | struct s s0 = { y: 5 }; |
| 18 | int array0[5] = { [3] 3 }; |
Douglas Gregor | a3a8351 | 2009-04-01 23:51:29 +0000 | [diff] [blame] | 19 | |
| 20 | void f1(x, y) |
| 21 | { |
| 22 | } |
| 23 | |
| 24 | int i0 = { 17 }; |
| 25 | |
| 26 | int f2(const char *my_string) { |
| 27 | // FIXME: terminal output isn't so good when "my_string" is shorter |
Douglas Gregor | a86b832 | 2009-04-06 18:45:53 +0000 | [diff] [blame] | 28 | return my_string == "foo"; |
Douglas Gregor | a3a8351 | 2009-04-01 23:51:29 +0000 | [diff] [blame] | 29 | } |