2009-12-16 04:14:24 +08:00
|
|
|
// RUN: %clang_cc1 %s -fsyntax-only -verify
|
2007-07-25 00:58:17 +08:00
|
|
|
|
|
|
|
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));
|
|
|
|
}
|
2008-07-27 03:51:01 +08:00
|
|
|
|
|
|
|
// 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}}
|
|
|
|
|
2009-01-25 07:09:00 +08:00
|
|
|
// PR3062
|
2009-04-18 14:51:21 +08:00
|
|
|
int test8[({10;})]; // expected-error {{statement expression not allowed at file scope}}
|
|
|
|
|
|
|
|
// PR3912
|
|
|
|
void test9(const void *P) {
|
|
|
|
__builtin_prefetch(P);
|
|
|
|
}
|
2009-10-30 12:01:58 +08:00
|
|
|
|
|
|
|
|
|
|
|
void *test10() {
|
|
|
|
bar:
|
|
|
|
return &&bar; // expected-warning {{returning address of label, which is local}}
|
|
|
|
}
|