From 8f07b2e440039b6994eddef30889c0327faaa05a Mon Sep 17 00:00:00 2001 From: Alexander Mai Date: Sun, 18 Oct 2015 11:52:25 +0200 Subject: [PATCH] #6922 valueFlowForward does not terminate: xorg/driver/xf86-video-neomagic : src/neo_driver.c (invalid code). Add regression test for previously fixed bug. --- test/testgarbage.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/testgarbage.cpp b/test/testgarbage.cpp index 5616cd700..d5d4c313c 100644 --- a/test/testgarbage.cpp +++ b/test/testgarbage.cpp @@ -191,6 +191,7 @@ private: TEST_CASE(garbageCode140); // #7035 TEST_CASE(garbageCode141); // #7043 TEST_CASE(garbageCode142); // #7050 + TEST_CASE(garbageCode143); // #6922 TEST_CASE(garbageValueFlow); TEST_CASE(garbageSymbolDatabase); @@ -1118,6 +1119,19 @@ private: checkCode("{ } ( ) { void mapGraphs ( ) { node_t * n ; for (!oid n ) { } } } { }"); } + void garbageCode143() { // #6922 + ASSERT_THROW(checkCode("void neoProgramShadowRegs() {\n" + " int i;\n" + " Bool noProgramShadowRegs;\n" + " if (noProgramShadowRegs) {\n" + " } else {\n" + " switch (nPtr->NeoPanelWidth) {\n" + " case 1280:\n" + " VGAwCR(0x64,0x?? );\n" + " }\n" + " }\n" + "}"), InternalError); + } void garbageValueFlow() { // #6089