Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -fsyntax-only -verify |
Chris Lattner | ab18c4c | 2007-07-24 16:58:17 +0000 | [diff] [blame] | 2 | |
| 3 | typedef unsigned __uint32_t; |
| 4 | |
| 5 | #define __byte_swap_int_var(x) \ |
| 6 | __extension__ ({ register __uint32_t __X = (x); \ |
| 7 | __asm ("bswap %0" : "+r" (__X)); \ |
| 8 | __X; }) |
| 9 | |
| 10 | int test(int _x) { |
| 11 | return (__byte_swap_int_var(_x)); |
| 12 | } |
Chris Lattner | 611b2ec | 2008-07-26 19:51:01 +0000 | [diff] [blame] | 13 | |
| 14 | // PR2374 |
| 15 | int test2() { return ({L:5;}); } |
Douglas Gregor | d4eea83 | 2010-04-09 00:35:39 +0000 | [diff] [blame^] | 16 | int test3() { return ({ {5;} }); } // expected-error {{returning 'void' from a function with incompatible result type 'int'}}\ |
Chris Lattner | 611b2ec | 2008-07-26 19:51:01 +0000 | [diff] [blame] | 17 | // expected-warning {{expression result unused}} |
| 18 | int test4() { return ({ ({5;}); }); } |
| 19 | int test5() { return ({L1: L2: L3: 5;}); } |
| 20 | int test6() { return ({5;}); } |
| 21 | void test7() { ({5;}); } // expected-warning {{expression result unused}} |
| 22 | |
Eli Friedman | dca2b73 | 2009-01-24 23:09:00 +0000 | [diff] [blame] | 23 | // PR3062 |
Chris Lattner | 40c56f7 | 2009-04-18 06:51:21 +0000 | [diff] [blame] | 24 | int test8[({10;})]; // expected-error {{statement expression not allowed at file scope}} |
| 25 | |
| 26 | // PR3912 |
| 27 | void test9(const void *P) { |
| 28 | __builtin_prefetch(P); |
| 29 | } |
Chris Lattner | 9e6b37a | 2009-10-30 04:01:58 +0000 | [diff] [blame] | 30 | |
| 31 | |
| 32 | void *test10() { |
| 33 | bar: |
| 34 | return &&bar; // expected-warning {{returning address of label, which is local}} |
| 35 | } |
Chris Lattner | 7e52de4 | 2010-01-24 01:50:29 +0000 | [diff] [blame] | 36 | |
| 37 | // PR6034 |
| 38 | void test11(int bit) { |
| 39 | switch (bit) |
| 40 | switch (env->fpscr) // expected-error {{use of undeclared identifier 'env'}} |
| 41 | { |
| 42 | } |
| 43 | } |