Permalink
Browse files

test(cpp,diag): add test cases for 2cbc103

  • Loading branch information...
mycoboco committed Jan 5, 2018
1 parent 43c5ec8 commit a83a3281f64f9bc18f946ceefc8e0e25b2344ed7
@@ -0,0 +1,6 @@
/* -Wv -X */
#define foo(...) , ## __VA_ARGS__
#define foo(...) ,##__VA_ARGS__
#define foo(...) , ##__VA_ARGS__
#define foo(...) ,## __VA_ARGS__
@@ -0,0 +1,3 @@
# 1 "./pp-mcr-variadic-17.c"
@@ -0,0 +1,21 @@
./pp-mcr-variadic-17.c:4:9: ERROR - redefinition of macro `foo'
#define foo(...) ,##__VA_ARGS__
^~~
./pp-mcr-variadic-17.c:3:9: note - previous definition was here
#define foo(...) , ## __VA_ARGS__
^~~
./pp-mcr-variadic-17.c:5:9: ERROR - redefinition of macro `foo'
#define foo(...) , ##__VA_ARGS__
^~~
./pp-mcr-variadic-17.c:3:9: note - previous definition was here
#define foo(...) , ## __VA_ARGS__
^~~
./pp-mcr-variadic-17.c:6:9: ERROR - redefinition of macro `foo'
#define foo(...) ,## __VA_ARGS__
^~~
./pp-mcr-variadic-17.c:3:9: note - previous definition was here
#define foo(...) , ## __VA_ARGS__
^~~
./pp-mcr-variadic-17.c:3:9: warning - macro `foo' defined but not used
#define foo(...) , ## __VA_ARGS__
^~~
@@ -0,0 +1,18 @@
/* -Wv -X */
#define foo1(x, ...) x ## , ## __VA_ARGS__ end
#define foo2(...) , ## __VA_ARGS__ end
#define foo3(...) , ## __VA_ARGS__ ## end
foo1(foo)
foo1(foo,)
foo1(foo, bar)
foo1(foo, bar, fred)
foo2()
foo2(foo)
foo2(foo, bar)
foo3()
foo3(foo)
foo3(foo, bar)
@@ -0,0 +1,16 @@
# 1 "./pp-mcr-variadic-18.c"
# 7 "./pp-mcr-variadic-18.c"
foo end
foo , end
foo ,bar end
foo ,bar, fred end
end
,foo end
,foo, bar end
end
,fooend
,foo, barend
@@ -0,0 +1,24 @@
./pp-mcr-variadic-18.c:3:24: ERROR - `##' generated multiple tokens from `foo,'
#define foo1(x, ...) x ## , ## __VA_ARGS__ end
^~
./pp-mcr-variadic-18.c:7:1: note - expanded from here
foo1(foo)
^~~~~~~~~
./pp-mcr-variadic-18.c:3:24: ERROR - `##' generated multiple tokens from `foo,'
#define foo1(x, ...) x ## , ## __VA_ARGS__ end
^~
./pp-mcr-variadic-18.c:8:1: note - expanded from here
foo1(foo,)
^~~~~~~~~~
./pp-mcr-variadic-18.c:3:24: ERROR - `##' generated multiple tokens from `foo,'
#define foo1(x, ...) x ## , ## __VA_ARGS__ end
^~
./pp-mcr-variadic-18.c:9:1: note - expanded from here
foo1(foo, bar)
^~~~~~~~~~~~~~
./pp-mcr-variadic-18.c:3:24: ERROR - `##' generated multiple tokens from `foo,'
#define foo1(x, ...) x ## , ## __VA_ARGS__ end
^~
./pp-mcr-variadic-18.c:10:1: note - expanded from here
foo1(foo, bar, fred)
^~~~~~~~~~~~~~~~~~~~
View
@@ -0,0 +1,18 @@
/* -Wv -X */
#define foo1(x, ...) x ## , ## __VA_ARGS__ end
#define foo2(...) , ## __VA_ARGS__ end
#define foo3(...) , ## __VA_ARGS__ ## end
foo1(foo)
foo1(foo,)
foo1(foo, bar)
foo1(foo, bar, fred)
foo2()
foo2(foo)
foo2(foo, bar)
foo3()
foo3(foo)
foo3(foo, bar)
@@ -0,0 +1,192 @@
./d-mcr-variadic.c:3:24: ERROR - `##' generated multiple tokens from `foo,'
#define foo1(x, ...) x ## , ## __VA_ARGS__ end
^~
./d-mcr-variadic.c:7:1: note - expanded from here
foo1(foo)
^~~~~~~~~
./d-mcr-variadic.c:3:24: ERROR - `##' generated multiple tokens from `foo,'
#define foo1(x, ...) x ## , ## __VA_ARGS__ end
^~
./d-mcr-variadic.c:8:1: note - expanded from here
foo1(foo,)
^~~~~~~~~~
./d-mcr-variadic.c:3:24: ERROR - `##' generated multiple tokens from `foo,'
#define foo1(x, ...) x ## , ## __VA_ARGS__ end
^~
./d-mcr-variadic.c:9:1: note - expanded from here
foo1(foo, bar)
^~~~~~~~~~~~~~
./d-mcr-variadic.c:3:24: ERROR - `##' generated multiple tokens from `foo,'
#define foo1(x, ...) x ## , ## __VA_ARGS__ end
^~
./d-mcr-variadic.c:10:1: note - expanded from here
foo1(foo, bar, fred)
^~~~~~~~~~~~~~~~~~~~
./d-mcr-variadic.c:3:22: ERROR - unknown type `foo'
#define foo1(x, ...) x ## , ## __VA_ARGS__ end
^~~~~~
./d-mcr-variadic.c:7:1: note - expanded from here
foo1(foo)
^~~~~~~~~
./d-mcr-variadic.c:3:47: ERROR - syntax error; expected `;' before `identifier'
#define foo1(x, ...) x ## , ## __VA_ARGS__ end
^
./d-mcr-variadic.c:7:1: note - expanded from here
foo1(foo)
^~~~~~~~~
./d-mcr-variadic.c:3:28: ERROR - empty declaration
#define foo1(x, ...) x ## , ## __VA_ARGS__ end
^
./d-mcr-variadic.c:8:1: note - expanded from here
foo1(foo,)
^~~~~~~~~~
./d-mcr-variadic.c:3:28: ERROR - syntax error; expected `;' before `,'
#define foo1(x, ...) x ## , ## __VA_ARGS__ end
^
./d-mcr-variadic.c:8:1: note - expanded from here
foo1(foo,)
^~~~~~~~~~
./d-mcr-variadic.c:3:44: warning - missing declaration specifier
#define foo1(x, ...) x ## , ## __VA_ARGS__ end
^
./d-mcr-variadic.c:8:1: note - expanded from here
foo1(foo,)
^~~~~~~~~~
./d-mcr-variadic.c:3:44: warning - type defaults to `int'
#define foo1(x, ...) x ## , ## __VA_ARGS__ end
^
./d-mcr-variadic.c:8:1: note - expanded from here
foo1(foo,)
^~~~~~~~~~
./d-mcr-variadic.c:3:47: ERROR - syntax error; expected `;' before `identifier'
#define foo1(x, ...) x ## , ## __VA_ARGS__ end
^
./d-mcr-variadic.c:8:1: note - expanded from here
foo1(foo,)
^~~~~~~~~~
./d-mcr-variadic.c:3:28: ERROR - empty declaration
#define foo1(x, ...) x ## , ## __VA_ARGS__ end
^
./d-mcr-variadic.c:9:1: note - expanded from here
foo1(foo, bar)
^~~~~~~~~~~~~~
./d-mcr-variadic.c:3:28: ERROR - syntax error; expected `;' before `,'
#define foo1(x, ...) x ## , ## __VA_ARGS__ end
^
./d-mcr-variadic.c:9:1: note - expanded from here
foo1(foo, bar)
^~~~~~~~~~~~~~
./d-mcr-variadic.c:9:11: ERROR - unknown type `bar'
foo1(foo, bar)
^~~
./d-mcr-variadic.c:3:44: ERROR - redeclaration of `end': `bar' vs `int'
#define foo1(x, ...) x ## , ## __VA_ARGS__ end
^~~
./d-mcr-variadic.c:9:1: note - expanded from here
foo1(foo, bar)
^~~~~~~~~~~~~~
./d-mcr-variadic.c:3:44: note - previous declaration was here
#define foo1(x, ...) x ## , ## __VA_ARGS__ end
^~~
./d-mcr-variadic.c:8:1: note - expanded from here
foo1(foo,)
^~~~~~~~~~
./d-mcr-variadic.c:3:47: ERROR - syntax error; expected `;' before `identifier'
#define foo1(x, ...) x ## , ## __VA_ARGS__ end
^
./d-mcr-variadic.c:9:1: note - expanded from here
foo1(foo, bar)
^~~~~~~~~~~~~~
./d-mcr-variadic.c:3:28: ERROR - empty declaration
#define foo1(x, ...) x ## , ## __VA_ARGS__ end
^
./d-mcr-variadic.c:10:1: note - expanded from here
foo1(foo, bar, fred)
^~~~~~~~~~~~~~~~~~~~
./d-mcr-variadic.c:3:28: ERROR - syntax error; expected `;' before `,'
#define foo1(x, ...) x ## , ## __VA_ARGS__ end
^
./d-mcr-variadic.c:10:1: note - expanded from here
foo1(foo, bar, fred)
^~~~~~~~~~~~~~~~~~~~
./d-mcr-variadic.c:10:14: ERROR - empty declaration
foo1(foo, bar, fred)
^
./d-mcr-variadic.c:10:14: ERROR - syntax error; expected `;' before `,'
foo1(foo, bar, fred)
^
./d-mcr-variadic.c:10:16: ERROR - unknown type `fred'
foo1(foo, bar, fred)
^~~~
./d-mcr-variadic.c:3:47: ERROR - syntax error; expected `;' before `identifier'
#define foo1(x, ...) x ## , ## __VA_ARGS__ end
^
./d-mcr-variadic.c:10:1: note - expanded from here
foo1(foo, bar, fred)
^~~~~~~~~~~~~~~~~~~~
./d-mcr-variadic.c:4:39: warning - missing declaration specifier
#define foo2(...) , ## __VA_ARGS__ end
^
./d-mcr-variadic.c:12:1: note - expanded from here
foo2()
^~~~~~
./d-mcr-variadic.c:4:39: warning - type defaults to `int'
#define foo2(...) , ## __VA_ARGS__ end
^
./d-mcr-variadic.c:12:1: note - expanded from here
foo2()
^~~~~~
./d-mcr-variadic.c:13:9: ERROR - syntax error; expected `;' before `identifier'
foo2(foo)
^
./d-mcr-variadic.c:4:39: warning - missing declaration specifier
#define foo2(...) , ## __VA_ARGS__ end
^
./d-mcr-variadic.c:13:1: note - expanded from here
foo2(foo)
^~~~~~~~~
./d-mcr-variadic.c:4:39: warning - type defaults to `int'
#define foo2(...) , ## __VA_ARGS__ end
^
./d-mcr-variadic.c:13:1: note - expanded from here
foo2(foo)
^~~~~~~~~
./d-mcr-variadic.c:14:14: ERROR - syntax error; expected `;' before `identifier'
foo2(foo, bar)
^
./d-mcr-variadic.c:4:39: warning - missing declaration specifier
#define foo2(...) , ## __VA_ARGS__ end
^
./d-mcr-variadic.c:14:1: note - expanded from here
foo2(foo, bar)
^~~~~~~~~~~~~~
./d-mcr-variadic.c:4:39: warning - type defaults to `int'
#define foo2(...) , ## __VA_ARGS__ end
^
./d-mcr-variadic.c:14:1: note - expanded from here
foo2(foo, bar)
^~~~~~~~~~~~~~
./d-mcr-variadic.c:4:42: ERROR - syntax error; expected `;' before `identifier'
#define foo2(...) , ## __VA_ARGS__ end
^
./d-mcr-variadic.c:14:1: note - expanded from here
foo2(foo, bar)
^~~~~~~~~~~~~~
./d-mcr-variadic.c:5:27: warning - missing declaration specifier
#define foo3(...) , ## __VA_ARGS__ ## end
^
./d-mcr-variadic.c:16:1: note - expanded from here
foo3()
^~~~~~
./d-mcr-variadic.c:5:27: warning - type defaults to `int'
#define foo3(...) , ## __VA_ARGS__ ## end
^
./d-mcr-variadic.c:16:1: note - expanded from here
foo3()
^~~~~~
./d-mcr-variadic.c:5:45: ERROR - syntax error; expected `;' before `end of input'
#define foo3(...) , ## __VA_ARGS__ ## end
^
./d-mcr-variadic.c:18:1: note - expanded from here
foo3(foo, bar)
^~~~~~~~~~~~~~

0 comments on commit a83a328

Please sign in to comment.