summaryrefslogtreecommitdiff
path: root/tests/counterexample.at
diff options
context:
space:
mode:
authorVincent Imbimbo <vmi6@cornell.edu>2020-05-16 14:51:44 -0400
committerAkim Demaille <akim.demaille@gmail.com>2020-05-22 07:52:27 +0200
commit482b370540289ea474868a50d614394e34cde860 (patch)
treeb26603db4bc6be1974ad8adcbf69932fa58f1548 /tests/counterexample.at
parent66283fb625d086c82c597b98c66442fc26d16f78 (diff)
downloadbison-482b370540289ea474868a50d614394e34cde860.tar.gz
cex: fix stack overflow
* src/parse-simulation.c: Replace reference counting with parse_state_retain everywhere. (free_parse_state): Make this function iterative instead of recursive. Long parse_state chains were causing stack exhaustion. * tests/counterexample.at: Fix expectations.
Diffstat (limited to 'tests/counterexample.at')
-rw-r--r--tests/counterexample.at79
1 files changed, 78 insertions, 1 deletions
diff --git a/tests/counterexample.at b/tests/counterexample.at
index 03c0a9a6..a1cbd3e0 100644
--- a/tests/counterexample.at
+++ b/tests/counterexample.at
@@ -419,7 +419,84 @@ d : a | c A | d;
]])
AT_BISON_CHECK([-Wcounterexample input.y], [], [],
-[[]])
+[[Reduce-Reduce Conflict:
+0: 3 b: . %empty
+0: 4 c: . %empty
+On Symbols: {A,}
+First Example • c A A $end
+First derivation $accept ::=[ a ::=[ b ::=[ • ] d ::=[ c A A ] ] $end ]
+Second Example • c A A $end
+Second derivation $accept ::=[ a ::=[ c ::=[ • ] d ::=[ c A A ] ] $end ]
+
+Reduce-Reduce Conflict:
+2: 3 b: . %empty
+2: 4 c: . %empty
+On Symbols: {A,}
+time limit exceeded: 6.000000
+First Example b • c A A $end
+First derivation $accept ::=[ a ::=[ b d ::=[ a ::=[ b ::=[ • ] d ::=[ c A A ] ] ] ] $end ]
+Second Example b • A $end
+Second derivation $accept ::=[ a ::=[ b d ::=[ c ::=[ • ] A ] ] $end ]
+
+Reduce-Reduce Conflict:
+3: 3 b: . %empty
+3: 4 c: . %empty
+On Symbols: {A,}
+time limit exceeded: 6.000000
+First Example c • c A A $end
+First derivation $accept ::=[ a ::=[ c d ::=[ a ::=[ b ::=[ • ] d ::=[ c A A ] ] ] ] $end ]
+Second Example c • A $end
+Second derivation $accept ::=[ a ::=[ c d ::=[ c ::=[ • ] A ] ] $end ]
+
+Shift-Reduce Conflict:
+6: 3 b: . %empty
+6: 6 d: c . A
+On Symbol: A
+time limit exceeded: 6.000000
+First Example b c • c A A $end
+First derivation $accept ::=[ a ::=[ b d ::=[ a ::=[ c d ::=[ a ::=[ b ::=[ • ] d ::=[ c A A ] ] ] ] ] ] $end ]
+Second Example b c • A
+Second derivation a ::=[ b d ::=[ c • A ] ]
+
+Reduce-Reduce Conflict:
+6: 3 b: . %empty
+6: 4 c: . %empty
+On Symbols: {A,}
+First Example b c • c A A $end
+First derivation $accept ::=[ a ::=[ b d ::=[ a ::=[ c d ::=[ a ::=[ b ::=[ • ] d ::=[ c A A ] ] ] ] ] ] $end ]
+Second Example b c • A $end
+Second derivation $accept ::=[ a ::=[ b d ::=[ a ::=[ c d ::=[ c ::=[ • ] A ] ] ] ] $end ]
+
+Shift-Reduce Conflict:
+6: 4 c: . %empty
+6: 6 d: c . A
+On Symbol: A
+First Example b c • A $end
+First derivation $accept ::=[ a ::=[ b d ::=[ a ::=[ c d ::=[ c ::=[ • ] A ] ] ] ] $end ]
+Second Example b c • A
+Second derivation a ::=[ b d ::=[ c • A ] ]
+
+Reduce-Reduce Conflict:
+7: 1 a: b d .
+7: 7 d: d .
+On Symbols: {$end,}
+Example b d •
+First derivation a ::=[ b d • ]
+Second derivation a ::=[ b d ::=[ d • ] ]
+
+Reduce-Reduce Conflict:
+8: 2 a: c d .
+8: 7 d: d .
+On Symbols: {$end,}
+Example c d •
+First derivation a ::=[ c d • ]
+Second derivation a ::=[ c d ::=[ d • ] ]
+
+input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
+input.y: warning: 6 reduce/reduce conflicts [-Wconflicts-rr]
+input.y:5.4: warning: rule useless in parser due to conflicts [-Wother]
+input.y:6.15: warning: rule useless in parser due to conflicts [-Wother]
+]])
AT_CLEANUP