Test case for unreachableCode (#4756)

This commit is contained in:
Andreas Bießmann 2013-06-18 06:40:43 +02:00 committed by Daniel Marjamäki
parent 2fb8133e90
commit 9b3a8774c5
1 changed files with 14 additions and 0 deletions

View File

@ -2827,6 +2827,20 @@ private:
" return g([](int x){x+1; return x;});\n"
"}", 0, false, false, false, false);
ASSERT_EQUALS("", errout.str());
// #4756
check("template <>\n"
"inline uint16_t htobe(uint16_t value) {\n"
" return ( __extension__ ({\n"
" register unsigned short int __v, __x = (unsigned short int) (value);\n"
" if (__builtin_constant_p (__x))\n"
" __v = ((unsigned short int) ((((__x) >> 8) & 0xff) | (((__x) & 0xff) << 8)));\n"
" else\n"
" __asm__ (\"rorw $8, %w0\" : \"=r\" (__v) : \"0\" (__x) : \"cc\");\n"
" __v;\n"
" }));\n"
"}", 0, false, false, false, false);
ASSERT_EQUALS("", errout.str());
}