Tom Care | b704270 | 2010-06-09 04:11:11 +0000 | [diff] [blame^] | 1 | // RUN: cp %s %t |
| 2 | // RUN: %clang_cc1 -pedantic -Wall -fixit %t || true |
| 3 | // RUN: %clang_cc1 -fsyntax-only -pedantic -Wall -Werror %t |
| 4 | |
| 5 | /* This is a test of the various code modification hints that are |
| 6 | provided as part of warning or extension diagnostics. All of the |
| 7 | warnings will be fixed by -fixit, and the resulting file should |
| 8 | compile cleanly with -Werror -pedantic. */ |
| 9 | |
| 10 | int printf(char const *, ...); |
| 11 | |
| 12 | void test() { |
| 13 | printf("%0s", (int) 123); |
| 14 | printf("abc%f", "testing testing 123"); |
| 15 | printf("%u", (long) -12); |
| 16 | printf("%+.2d", (unsigned long long) 123456); |
| 17 | printf("%1d", (long double) 1.23); |
| 18 | printf("%Ld", (long double) -4.56); |
| 19 | printf("%1$f:%2$.*3$f:%4$.*3$f\n", 1, 2, 3, 4); |
| 20 | } |