diff options
Diffstat (limited to 'test/Sema/warn-unsequenced.c')
-rw-r--r-- | test/Sema/warn-unsequenced.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/Sema/warn-unsequenced.c b/test/Sema/warn-unsequenced.c index 247a121941..9654cda924 100644 --- a/test/Sema/warn-unsequenced.c +++ b/test/Sema/warn-unsequenced.c @@ -95,4 +95,11 @@ void test() { _Alignof(++a) + ++a; // expected-warning {{extension}} __builtin_constant_p(f(++a, 0)) ? f(f(++a, 0), f(++a, 0)) : 0; + + if (0) ++a + ++a; // ok, unreachable +} + +void g(const char *p, int n) { + // This resembles code produced by some macros in glibc's <string.h>. + __builtin_constant_p(p) && __builtin_constant_p(++n) && (++n + ++n); } |