uninitvar: Added a regression test for #7736
This commit is contained in:
parent
899b88754f
commit
e072c2d786
|
@ -2249,6 +2249,12 @@ private:
|
||||||
"}");
|
"}");
|
||||||
ASSERT_EQUALS("[test.cpp:3]: (error) Uninitialized variable: x\n", errout.str());
|
ASSERT_EQUALS("[test.cpp:3]: (error) Uninitialized variable: x\n", errout.str());
|
||||||
|
|
||||||
|
checkUninitVar("void f() {\n" // #7736
|
||||||
|
" int buf[12];\n"
|
||||||
|
" printf (\"%d\", buf[0] );\n"
|
||||||
|
"}");
|
||||||
|
ASSERT_EQUALS("[test.cpp:3]: (error) Uninitialized variable: buf\n", errout.str());
|
||||||
|
|
||||||
checkUninitVar("void f() {\n"
|
checkUninitVar("void f() {\n"
|
||||||
" int x;\n"
|
" int x;\n"
|
||||||
" int y = x & 3;\n"
|
" int y = x & 3;\n"
|
||||||
|
|
Loading…
Reference in New Issue