diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java index 221f3ee0ef5..c76133a3a7f 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java @@ -10632,4 +10632,35 @@ public class AST2CPPTests extends AST2TestBase { public void testParenthesizedReferenceArgument_424898() throws Exception { parseAndCheckBindings(); } + + // constexpr int naive_fibonacci(int x) { + // return x == 0 ? 0 + // : x == 1 ? 1 + // : naive_fibonacci(x - 2) + naive_fibonacci(x - 1); + // } + // + // constexpr int waldo = naive_fibonacci(5); + public void testConditionalExpressionFolding_429891() throws Exception { + BindingAssertionHelper helper = getAssertionHelper(); + IVariable waldo = helper.assertNonProblem("waldo"); + assertEquals(5, waldo.getInitialValue().numericalValue().longValue()); + } + + + // constexpr int naive_fibonacci(int x) { + // return x == 0 ? 0 + // : x == 1 ? 1 + // : naive_fibonacci(x - 2) + naive_fibonacci(x - 1); + // } + // + // constexpr int waldo = naive_fibonacci(50); + public void testConstexprEvaluationLimit_429891() throws Exception { + // Here we're just checking that the computation of the initial + // value finishes (with a null result) in a reasonable time. + // If we tried to run the computation of naive_fibonacci(50) + // to its end, the IDE would appear to hang. + BindingAssertionHelper helper = getAssertionHelper(); + IVariable waldo = helper.assertNonProblem("waldo"); + assertNull(waldo.getInitialValue().numericalValue()); + } } diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java index 919b1bec310..2e0ba985b97 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java @@ -8477,35 +8477,4 @@ public class AST2TemplateTests extends AST2TestBase { public void testConstexprFunctionCallWithNonConstexprArguments_429891() throws Exception { parseAndCheckBindings(); } - - // constexpr int naive_fibonacci(int x) { - // return x == 0 ? 0 - // : x == 1 ? 1 - // : naive_fibonacci(x - 2) + naive_fibonacci(x - 1); - // } - // - // constexpr int waldo = naive_fibonacci(5); - public void testConditionalExpressionFolding_429891() throws Exception { - BindingAssertionHelper helper = getAssertionHelper(); - IVariable waldo = helper.assertNonProblem("waldo"); - assertEquals(5, waldo.getInitialValue().numericalValue().longValue()); - } - - - // constexpr int naive_fibonacci(int x) { - // return x == 0 ? 0 - // : x == 1 ? 1 - // : naive_fibonacci(x - 2) + naive_fibonacci(x - 1); - // } - // - // constexpr int waldo = naive_fibonacci(50); - public void testConstexprEvaluationLimit_429891() throws Exception { - // Here we're just checking that the computation of the initial - // value finishes (with a null result) in a reasonable time. - // If we tried to run the computation of naive_fibonacci(50) - // to its end, the IDE would appear to hang. - BindingAssertionHelper helper = getAssertionHelper(); - IVariable waldo = helper.assertNonProblem("waldo"); - assertNull(waldo.getInitialValue().numericalValue()); - } }