Fix preprocessor concat with empty arg
This commit is contained in:
14
tests/tests2/67_macro_concat.c
Normal file
14
tests/tests2/67_macro_concat.c
Normal file
@ -0,0 +1,14 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#define P(A,B) A ## B ; bob
|
||||
#define Q(A,B) A ## B+
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int bob, jim = 21;
|
||||
bob = P(jim,) *= 2;
|
||||
printf("jim: %d, bob: %d\n", jim, bob);
|
||||
jim = 60 Q(+,)3;
|
||||
printf("jim: %d\n", jim);
|
||||
return 0;
|
||||
}
|
||||
2
tests/tests2/67_macro_concat.expect
Normal file
2
tests/tests2/67_macro_concat.expect
Normal file
@ -0,0 +1,2 @@
|
||||
jim: 21, bob: 42
|
||||
jim: 63
|
||||
@ -81,7 +81,8 @@ TESTS = \
|
||||
63_local_enumerator_redefinition.test \
|
||||
64_macro_nesting.test \
|
||||
65_macro_concat_start.test \
|
||||
66_macro_concat_end.test
|
||||
66_macro_concat_end.test \
|
||||
67_macro_concat.test
|
||||
|
||||
# 30_hanoi.test -- seg fault in the code, gcc as well
|
||||
# 34_array_assignment.test -- array assignment is not in C standard
|
||||
|
||||
Reference in New Issue
Block a user