Douglas Gregor | 558cb56 | 2009-04-02 01:08:08 +0000 | [diff] [blame] | 1 | // RUN: clang -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 | 9b3064b | 2009-04-01 22:41:11 +0000 | [diff] [blame] | 7 | |
| 8 | void f0(void) { }; |
| 9 | |
| 10 | struct s { |
| 11 | int x, y;; |
| 12 | }; |
| 13 | |
| 14 | _Complex cd; |
| 15 | |
| 16 | struct s s0 = { y: 5 }; |
| 17 | int array0[5] = { [3] 3 }; |
Douglas Gregor | a3a8351 | 2009-04-01 23:51:29 +0000 | [diff] [blame] | 18 | |
| 19 | void f1(x, y) |
| 20 | { |
| 21 | } |
| 22 | |
| 23 | int i0 = { 17 }; |
| 24 | |
| 25 | int f2(const char *my_string) { |
| 26 | // FIXME: terminal output isn't so good when "my_string" is shorter |
Douglas Gregor | 558cb56 | 2009-04-02 01:08:08 +0000 | [diff] [blame] | 27 | // FIXME: Needs an #include hint, too! |
| 28 | // return my_string == "foo"; |
Douglas Gregor | a3a8351 | 2009-04-01 23:51:29 +0000 | [diff] [blame] | 29 | } |