Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gcc.dg/cpp/trad/argcount.c @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children | 84e7813d76e9 |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 /* Test that we correctly complain about an invalid number of macro | |
2 arguments. */ | |
3 | |
4 /* { dg-do preprocess } */ | |
5 | |
6 #define f(x) x | |
7 #define g(x, y) x y | |
8 #define h() | |
9 | |
10 f(); /* { dg-bogus "requires 1" "no arg is 1 empty arg" } */ | |
11 f( ); /* { dg-bogus "macro" "1 arg to 1 param macro" } */ | |
12 f(1,); /* { dg-error "passed 2" "2 args to 1 param macro" } */ | |
13 f(1,2); /* { dg-error "passed 2" "2 args to 1 param macro" } */ | |
14 h(); /* { dg-bogus "macro" "no arg to 1 param macro" } */ | |
15 h( ); /* { dg-error "passed 1" "1 arg to 0 param macro" } */ | |
16 h(1,2); /* { dg-error "passed 2" "2 args to 0 param macro" } */ | |
17 g(); /* { dg-error "requires 2" "0 args to 2 param macro" } */ | |
18 g( ); /* { dg-error "requires 2" "1 args to 2 param macro" } */ | |
19 g( ,2); /* { dg-bogus "requires 2" "2 args to 2 param macro" } */ | |
20 g(,); /* { dg-bogus "requires 2" "2 args to 2 param macro" } */ | |
21 g(1,2,3); /* { dg-error "passed 3" "3 args to 2 param macro" } */ |