Scott Douglass | cc01359 | 2015-06-10 15:18:23 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -Wno-gnu-statement-expression |
| 2 | |
| 3 | int stmtexpr_fn(); |
| 4 | void stmtexprs(int i) { |
| 5 | __builtin_assume( ({ 1; }) ); // no warning about "side effects" |
| 6 | __builtin_assume( ({ if (i) { (void)0; }; 42; }) ); // no warning about "side effects" |
| 7 | // expected-warning@+1 {{the argument to '__builtin_assume' has side effects that will be discarded}} |
| 8 | __builtin_assume( ({ if (i) ({ stmtexpr_fn(); }); 1; }) ); |
| 9 | } |