diff options
author | dim <dim@FreeBSD.org> | 2015-06-21 14:00:56 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-06-21 14:00:56 +0000 |
commit | 9dd834653b811ad20382e98a87dff824980c9916 (patch) | |
tree | a764184c2fc9486979b074250b013a0937ee64e5 /test/Sema/stmtexprs.c | |
parent | bb9760db9b86e93a638ed430d0a14785f7ff9064 (diff) | |
download | FreeBSD-src-9dd834653b811ad20382e98a87dff824980c9916.zip FreeBSD-src-9dd834653b811ad20382e98a87dff824980c9916.tar.gz |
Vendor import of clang trunk r240225:
https://llvm.org/svn/llvm-project/cfe/trunk@240225
Diffstat (limited to 'test/Sema/stmtexprs.c')
-rw-r--r-- | test/Sema/stmtexprs.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/Sema/stmtexprs.c b/test/Sema/stmtexprs.c new file mode 100644 index 0000000..8594aae --- /dev/null +++ b/test/Sema/stmtexprs.c @@ -0,0 +1,9 @@ +// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -Wno-gnu-statement-expression + +int stmtexpr_fn(); +void stmtexprs(int i) { + __builtin_assume( ({ 1; }) ); // no warning about "side effects" + __builtin_assume( ({ if (i) { (void)0; }; 42; }) ); // no warning about "side effects" + // expected-warning@+1 {{the argument to '__builtin_assume' has side effects that will be discarded}} + __builtin_assume( ({ if (i) ({ stmtexpr_fn(); }); 1; }) ); +} |