Mercurial > hg > CbC > CbC_gcc
diff gcc/testsuite/gcc.dg/format/diagnostic-ranges.c @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line diff
--- a/gcc/testsuite/gcc.dg/format/diagnostic-ranges.c Fri Oct 27 22:46:09 2017 +0900 +++ b/gcc/testsuite/gcc.dg/format/diagnostic-ranges.c Thu Oct 25 07:37:49 2018 +0900 @@ -11,6 +11,8 @@ /* { dg-begin-multiline-output "" } printf("hello %i", msg); ~^ ~~~ + | | + int const char * %s { dg-end-multiline-output "" } */ @@ -19,6 +21,9 @@ /* { dg-begin-multiline-output "" } printf("hello %s", 42); ~^ ~~ + | | + | int + char * %d { dg-end-multiline-output "" } */ @@ -26,6 +31,8 @@ /* { dg-begin-multiline-output "" } printf("hello %i", (long)0); ~^ ~~~~~~~ + | | + int long int %li { dg-end-multiline-output "" } */ } @@ -37,9 +44,13 @@ /* { dg-begin-multiline-output "" } printf ("arg0: %i arg1: %s arg 2: %i", ~^ + | + char * %d 100, 101, 102); ~~~ + | + int { dg-end-multiline-output "" } */ } @@ -50,9 +61,13 @@ /* { dg-begin-multiline-output "" } printf ("arg0: %i arg1: %s arg 2: %i", ~^ + | + char * %d 100, i + j, 102); ~~~~~ + | + int { dg-end-multiline-output "" } */ } @@ -72,6 +87,8 @@ ~~ "d" ~^ + | + int { dg-end-multiline-output "" } */ } @@ -84,6 +101,8 @@ /* { dg-begin-multiline-output "" } printf("hello \x25\x69", msg); ~~~~^~~~ ~~~ + | | + int const char * \x25s { dg-end-multiline-output "" } */ } @@ -97,6 +116,8 @@ /* { dg-begin-multiline-output "" } printf("hello \045\151", msg); ~~~~^~~~ ~~~ + | | + int const char * \045s { dg-end-multiline-output "" } */ } @@ -112,11 +133,15 @@ ^~~~~~~~ msg); ~~~ + | + const char * { dg-end-multiline-output "" } */ /* { dg-begin-multiline-output "" } printf("prefix" "\x25" "\151" "suffix", ~~~~~~~~^~~~ + | + int \x25" "s { dg-end-multiline-output "" } */ } @@ -127,6 +152,8 @@ /* { dg-begin-multiline-output "" } printf(u8"hello %i", msg); ~^ ~~~ + | | + int const char * %s { dg-end-multiline-output "" } */ } @@ -137,6 +164,8 @@ /* { dg-begin-multiline-output "" } printf ("foo %s bar", long_i + long_j); ~^ ~~~~~~~~~~~~~~~ + | | + char * long int %ld { dg-end-multiline-output "" } */ } @@ -147,6 +176,8 @@ /* { dg-begin-multiline-output "" } printf (" %*.*d ", l, i1, i2); ~^~~~ ~ + | | + int long int { dg-end-multiline-output "" } */ } @@ -158,12 +189,16 @@ /* { dg-begin-multiline-output "" } __builtin_sprintf (d, " %*ld ", foo, foo); ~^~~ ~~~ + | | + int long int { dg-end-multiline-output "" } */ __builtin_sprintf (d, " %*ld ", foo + bar, foo); /* { dg-warning "28: field width specifier '\\*' expects argument of type 'int', but argument 3 has type 'long int'" } */ /* { dg-begin-multiline-output "" } __builtin_sprintf (d, " %*ld ", foo + bar, foo); ~^~~ ~~~~~~~~~ + | | + int long int { dg-end-multiline-output "" } */ } @@ -173,12 +208,16 @@ /* { dg-begin-multiline-output "" } __builtin_sprintf (d, " %.*ld ", foo, foo); ~~^~~ ~~~ + | | + int long int { dg-end-multiline-output "" } */ __builtin_sprintf (d, " %.*ld ", foo + bar, foo); /* { dg-warning "29: field precision specifier '\\.\\*' expects argument of type 'int', but argument 3 has type 'long int'" } */ /* { dg-begin-multiline-output "" } __builtin_sprintf (d, " %.*ld ", foo + bar, foo); ~~^~~ ~~~~~~~~~ + | | + int long int { dg-end-multiline-output "" } */ } @@ -241,10 +280,14 @@ /* { dg-begin-multiline-output "" } printf("hello " INT_FMT " world", msg); ^~~~~~~~ ~~~ + | + const char * { dg-end-multiline-output "" } */ /* { dg-begin-multiline-output "" } #define INT_FMT "%i" ~^ + | + int %s { dg-end-multiline-output "" } */ #undef INT_FMT @@ -257,17 +300,22 @@ /* { dg-begin-multiline-output "" } printf("hello %" PRIu32 " world", msg); ^~~~~~~~~ ~~~ + | + const char * { dg-end-multiline-output "" } */ /* { dg-begin-multiline-output "" } #define PRIu32 "u" ^ + | + unsigned int { dg-end-multiline-output "" } */ #undef PRIu32 } void test_macro_3 (const char *msg) { -#define FMT_STRING "hello %i world" /* { dg-warning "20: format '%i' expects argument of type 'int', but argument 2 has type 'const char \\*' " } */ +#define FMT_STRING "hello %i world" /* { dg-line test_macro_3_macro_line } */ + /* { dg-warning "20: format '%i' expects argument of type 'int', but argument 2 has type 'const char \\*'" "" { target *-*-*} .-1 } */ printf(FMT_STRING, msg); /* { dg-message "10: in expansion of macro 'FMT_STRING" } */ /* { dg-begin-multiline-output "" } #define FMT_STRING "hello %i world" @@ -277,6 +325,14 @@ printf(FMT_STRING, msg); ^~~~~~~~~~ { dg-end-multiline-output "" } */ +/* { dg-message "28: format string is defined here" "" { target *-*-* } test_macro_3_macro_line } */ +/* { dg-begin-multiline-output "" } + #define FMT_STRING "hello %i world" + ~^ + | + int + %s + { dg-end-multiline-output "" } */ #undef FMT_STRING } @@ -295,6 +351,8 @@ /* { dg-begin-multiline-output "" } #define FMT_STRING "hello %i world" ~^ + | + int %s { dg-end-multiline-output "" } */ #undef FMT_STRING @@ -307,10 +365,14 @@ /* { dg-begin-multiline-output "" } __builtin_printf(" %" "d ", 0.5); ^~~~ ~~~ + | + double { dg-end-multiline-output "" } */ /* { dg-begin-multiline-output "" } __builtin_printf(" %" "d ", 0.5); ~~~~^ + | + int %" "f { dg-end-multiline-output "" } */ } @@ -324,5 +386,7 @@ /* { dg-begin-multiline-output "" } __builtin_printf(a, 0.5); ^ ~~~ + | + double { dg-end-multiline-output "" } */ }