[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Sema / stmtexprs.c
blob7493bbcef363d9350a4ac8a764deff582496eda0
1 // RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -Wno-gnu-statement-expression
3 int stmtexpr_fn(void);
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 {{assumption is ignored because it contains (potential) side-effects}}
8 __builtin_assume( ({ if (i) ({ stmtexpr_fn(); }); 1; }) );