diff options
author | David Malcolm <dmalcolm@redhat.com> | 2016-03-11 19:48:49 +0000 |
---|---|---|
committer | David Malcolm <dmalcolm@gcc.gnu.org> | 2016-03-11 19:48:49 +0000 |
commit | 318c1204185bb06f51056ff875180b874baf4ce4 (patch) | |
tree | 2cdf97922517d8f3c7b5ef9d4f709fe2f4a31402 | |
parent | bc062234d66030553bcb7a11c02fbf91e503609b (diff) | |
download | gcc-318c1204185bb06f51056ff875180b874baf4ce4.zip gcc-318c1204185bb06f51056ff875180b874baf4ce4.tar.gz gcc-318c1204185bb06f51056ff875180b874baf4ce4.tar.bz2 |
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.
From-SVN: r234145
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/c-c++-common/Wmisleading-indentation.c | 16 |
2 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 430e354..34a61a3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-03-11 David Malcolm <dmalcolm@redhat.com> + + PR c/70085 + * c-c++-common/Wmisleading-indentation.c (pr70085): New test case. + 2016-03-11 Kyrylo Tkachov <kyrylo.tkachov@arm.com> * 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 7b499d4..38c8aec 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 |