History

Add tests for previous fixes

Add tests for the fixes made in commits 76cb1144ef91924c53c57ea71e6f67ce73ce1cc6, a465b7f58fdea15caa1bfb81ff5e985c94c4df4a, 0f522fb32a635dafce30f3ce3ff2cb15bcec809e, 82969f045c99b4d1ef833de35117c17b326b46c0 and 673befd2d7745a90c1c4fcb6d2f0e266c04f8c97.

Thomas Preud'homme committed 12 years ago

Commit 80811671 parent fdc31e111 files · +30 −1Browse files

Unified · Split

11 files
  1. tests/tests2/58_function_redefinition.c +9 −0
  2. tests/tests2/58_function_redefinition.expect +1 −0
  3. tests/tests2/59_function_array.c +1 −0
  4. tests/tests2/59_function_array.expect +1 −0
  5. tests/tests2/60_enum_redefinition.c +4 −0
  6. tests/tests2/60_enum_redefinition.expect +1 −0
  7. tests/tests2/61_undefined_enum.c +1 −0
  8. tests/tests2/61_undefined_enum.expect +1 −0
  9. tests/tests2/62_enumerator_redefinition.c +4 −0
  10. tests/tests2/62_enumerator_redefinition.expect +1 −0
  11. tests/tests2/Makefile +6 −1
tests/tests2/58_function_redefinition.c+9−0
@@ -0,0 +1,9 @@
1+int f(void)
2+{
3+ return 0;
4+}
5+
6+int f(void)
7+{
8+ return 1;
9+}
tests/tests2/58_function_redefinition.expect+1−0
@@ -0,0 +1 @@
1+58_function_redefinition.c:7: error: redefinition of 'f'
tests/tests2/59_function_array.c+1−0
@@ -0,0 +1 @@
1+int (*fct)[42](int x);
tests/tests2/59_function_array.expect+1−0
@@ -0,0 +1 @@
1+59_function_array.c:1: error: declaration of an array of functions
tests/tests2/60_enum_redefinition.c+4−0
@@ -0,0 +1,4 @@
1+enum color {RED, GREEN, BLUE};
2+enum color {R, G, B};
3+
4+enum color c;
tests/tests2/60_enum_redefinition.expect+1−0
@@ -0,0 +1 @@
1+60_enum_redefinition.c:2: error: struct/union/enum already defined
tests/tests2/61_undefined_enum.c+1−0
@@ -0,0 +1 @@
1+enum rgb c = 42;
tests/tests2/61_undefined_enum.expect+1−0
@@ -0,0 +1 @@
1+61_undefined_enum.c:1: error: unknown struct/union/enum
tests/tests2/62_enumerator_redefinition.c+4−0
@@ -0,0 +1,4 @@
1+enum color {RED, GREEN, BLUE};
2+enum rgb {RED, G, B};
3+
4+enum color c = RED;
tests/tests2/62_enumerator_redefinition.expect+1−0
@@ -0,0 +1 @@
1+62_enumerator_redefinition.c:2: error: redefinition of enumerator 'RED'
tests/tests2/Makefile+6−1
@@ -69,7 +69,12 @@ TESTS = \ · 68 unmodified lines
6969 54_goto.test \
7070 55_lshift_type.test \
7171 56_btype_excess-1.test \
72− 57_btype_excess-2.test
72+ 57_btype_excess-2.test \
73+ 58_function_redefinition.test \
74+ 59_function_array.test \
75+ 60_enum_redefinition.test \
76+ 61_undefined_enum.test \
77+ 62_enumerator_redefinition.test
7378
7479 # 30_hanoi.test -- seg fault in the code, gcc as well
7580 # 34_array_assignment.test -- array assignment is not in C standard

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t