From 9b3a8774c58785eaa6d91e1053a499e066ff4393 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Bie=C3=9Fmann?= Date: Tue, 18 Jun 2013 06:40:43 +0200 Subject: [PATCH] Test case for unreachableCode (#4756) --- test/testother.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/testother.cpp b/test/testother.cpp index 5670a8493..b02c47198 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -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()); }