Add tests for previous fixes
Add tests for the fixes made in commits76cb1144ef,a465b7f58f,0f522fb32a,82969f045cand673befd2d7.
This commit is contained in:
9
tests/tests2/58_function_redefinition.c
Normal file
9
tests/tests2/58_function_redefinition.c
Normal file
@ -0,0 +1,9 @@
|
||||
int f(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int f(void)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
1
tests/tests2/58_function_redefinition.expect
Normal file
1
tests/tests2/58_function_redefinition.expect
Normal file
@ -0,0 +1 @@
|
||||
58_function_redefinition.c:7: error: redefinition of 'f'
|
||||
1
tests/tests2/59_function_array.c
Normal file
1
tests/tests2/59_function_array.c
Normal file
@ -0,0 +1 @@
|
||||
int (*fct)[42](int x);
|
||||
1
tests/tests2/59_function_array.expect
Normal file
1
tests/tests2/59_function_array.expect
Normal file
@ -0,0 +1 @@
|
||||
59_function_array.c:1: error: declaration of an array of functions
|
||||
4
tests/tests2/60_enum_redefinition.c
Normal file
4
tests/tests2/60_enum_redefinition.c
Normal file
@ -0,0 +1,4 @@
|
||||
enum color {RED, GREEN, BLUE};
|
||||
enum color {R, G, B};
|
||||
|
||||
enum color c;
|
||||
1
tests/tests2/60_enum_redefinition.expect
Normal file
1
tests/tests2/60_enum_redefinition.expect
Normal file
@ -0,0 +1 @@
|
||||
60_enum_redefinition.c:2: error: struct/union/enum already defined
|
||||
1
tests/tests2/61_undefined_enum.c
Normal file
1
tests/tests2/61_undefined_enum.c
Normal file
@ -0,0 +1 @@
|
||||
enum rgb c = 42;
|
||||
1
tests/tests2/61_undefined_enum.expect
Normal file
1
tests/tests2/61_undefined_enum.expect
Normal file
@ -0,0 +1 @@
|
||||
61_undefined_enum.c:1: error: unknown struct/union/enum
|
||||
4
tests/tests2/62_enumerator_redefinition.c
Normal file
4
tests/tests2/62_enumerator_redefinition.c
Normal file
@ -0,0 +1,4 @@
|
||||
enum color {RED, GREEN, BLUE};
|
||||
enum rgb {RED, G, B};
|
||||
|
||||
enum color c = RED;
|
||||
1
tests/tests2/62_enumerator_redefinition.expect
Normal file
1
tests/tests2/62_enumerator_redefinition.expect
Normal file
@ -0,0 +1 @@
|
||||
62_enumerator_redefinition.c:2: error: redefinition of enumerator 'RED'
|
||||
@ -69,7 +69,12 @@ TESTS = \
|
||||
54_goto.test \
|
||||
55_lshift_type.test \
|
||||
56_btype_excess-1.test \
|
||||
57_btype_excess-2.test
|
||||
57_btype_excess-2.test \
|
||||
58_function_redefinition.test \
|
||||
59_function_array.test \
|
||||
60_enum_redefinition.test \
|
||||
61_undefined_enum.test \
|
||||
62_enumerator_redefinition.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