1 /* Test for redefining macros with significant differences. */ 2 3 /* { dg-do preprocess } 4 { dg-options "-ansi -Wall" } */ 5 6 #define mac(a, b) (a) + (b) 7 #define mac(a, b) (a) * (b) 8 #define mac(a, b) (a) * (x) 9 #define mac(a, g) (a) * (x) 10 11 #define ro(x) foo x bar 12 #define ro(x, b) foo x bar 13 14 #define va(a...) a 15 #define va(...) __VA_ARGS__ 16 17 #define foo(x) x 18 #define foo(x)x /* { dg-bogus "redefined" "redefined foo" } */ 19 20 /* { dg-warning "redefined" "redef mac" { target *-*-* } 7 } 21 { dg-warning "redefined" "redef mac" { target *-*-* } 8 } 22 { dg-warning "redefined" "redef mac" { target *-*-* } 9 } 23 { dg-warning "redefined" "redef ro" { target *-*-* } 12 } 24 { dg-warning "redefined" "redef va" { target *-*-* } 15 } 25 26 { dg-message "previous" "prev def mac" { target *-*-* } 6 } 27 { dg-message "previous" "prev def mac" { target *-*-* } 7 } 28 { dg-message "previous" "prev def mac" { target *-*-* } 8 } 29 { dg-message "previous" "prev def ro" { target *-*-* } 11 } 30 { dg-message "previous" "prev def va" { target *-*-* } 14 } 31 */ 32