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 |
| 4 | provided as part of warning or extension diagnostics. Eventually, |
| 5 | we would like to actually try to perform the suggested |
| 6 | modifications and compile the result to test that no warnings |
| 7 | remain. */ |
| 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 | 558cb56 | 2009-04-02 01:08:08 +0000 | [diff] [blame^] | 28 | // FIXME: Needs an #include hint, too! |
| 29 | // return my_string == "foo"; |
Douglas Gregor | a3a8351 | 2009-04-01 23:51:29 +0000 | [diff] [blame] | 30 | } |