From: dmalcolm Date: Fri, 11 Mar 2016 19:48:49 +0000 (+0000) Subject: Wmisleading-indentation: add reproducer for PR c/70085 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ce234f270b1a8bc53e015c228dacefee697eeaf6;p=thirdparty%2Fgcc.git Wmisleading-indentation: add reproducer for PR c/70085 PR c/70085 reported a false-positive from -Wmisleading-indentation. The warning was fixed by the fix for PR c/68187 (r233972), but it seems worth capturing the reproducer for PR c/70085 as an additional test case, as it's slightly different to those seen in PR c/68187. gcc/testsuite/ChangeLog: PR c/70085 * c-c++-common/Wmisleading-indentation.c (pr70085): New test case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@234145 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 430e35472b08..34a61a3d7c27 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-03-11 David Malcolm + + PR c/70085 + * c-c++-common/Wmisleading-indentation.c (pr70085): New test case. + 2016-03-11 Kyrylo Tkachov * gcc.target/aarch64/vect-reduc-or_1.c: Add -fno-vect-cost-model to diff --git a/gcc/testsuite/c-c++-common/Wmisleading-indentation.c b/gcc/testsuite/c-c++-common/Wmisleading-indentation.c index 7b499d410fc3..38c8aecc4b2e 100644 --- a/gcc/testsuite/c-c++-common/Wmisleading-indentation.c +++ b/gcc/testsuite/c-c++-common/Wmisleading-indentation.c @@ -1054,3 +1054,19 @@ fn_42_c (int locked, int i) return 0; #undef engine_ref_debug } + +/* We shouldn't complain about the following function. */ +#define ENABLE_FEATURE +int pr70085 (int x, int y) +{ + if (x > y) + return x - y; + + #ifdef ENABLE_FEATURE + if (x == y) + return 0; + #endif + + return -1; +} +#undef ENABLE_FEATURE