diff options
author | ed <ed@FreeBSD.org> | 2009-06-02 17:58:47 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2009-06-02 17:58:47 +0000 |
commit | f27e5a09a0d815b8a4814152954ff87dadfdefc0 (patch) | |
tree | ce7d964cbb5e39695b71481698f10cb099c23d4a /test/Sema/statements.c | |
download | FreeBSD-src-f27e5a09a0d815b8a4814152954ff87dadfdefc0.zip FreeBSD-src-f27e5a09a0d815b8a4814152954ff87dadfdefc0.tar.gz |
Import Clang, at r72732.
Diffstat (limited to 'test/Sema/statements.c')
-rw-r--r-- | test/Sema/statements.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/Sema/statements.c b/test/Sema/statements.c new file mode 100644 index 0000000..9a71a40 --- /dev/null +++ b/test/Sema/statements.c @@ -0,0 +1,29 @@ +// RUN: clang-cc %s -fsyntax-only -verify + +typedef unsigned __uint32_t; + +#define __byte_swap_int_var(x) \ +__extension__ ({ register __uint32_t __X = (x); \ + __asm ("bswap %0" : "+r" (__X)); \ + __X; }) + +int test(int _x) { + return (__byte_swap_int_var(_x)); +} + +// PR2374 +int test2() { return ({L:5;}); } +int test3() { return ({ {5;} }); } // expected-error {{incompatible type returning 'void', expected 'int'}}\ + // expected-warning {{expression result unused}} +int test4() { return ({ ({5;}); }); } +int test5() { return ({L1: L2: L3: 5;}); } +int test6() { return ({5;}); } +void test7() { ({5;}); } // expected-warning {{expression result unused}} + +// PR3062 +int test8[({10;})]; // expected-error {{statement expression not allowed at file scope}} + +// PR3912 +void test9(const void *P) { + __builtin_prefetch(P); +} |