summaryrefslogtreecommitdiffstats
path: root/test/Parser/expressions.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Parser/expressions.c')
-rw-r--r--test/Parser/expressions.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/test/Parser/expressions.c b/test/Parser/expressions.c
index 44ebe66..ffc5c83 100644
--- a/test/Parser/expressions.c
+++ b/test/Parser/expressions.c
@@ -1,19 +1,17 @@
-// RUN: %clang_cc1 -parse-noop -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify %s
void test1() {
- if (sizeof (int){ 1}); // sizeof compound literal
- if (sizeof (int)); // sizeof type
+ if (sizeof (int){ 1}) {} // sizeof compound literal
+ if (sizeof (int)) {} // sizeof type
- (int)4; // cast.
- (int){4}; // compound literal.
+ (void)(int)4; // cast.
+ (void)(int){4}; // compound literal.
- // FIXME: change this to the struct version when we can.
- //int A = (struct{ int a;}){ 1}.a;
- int A = (int){ 1}.a;
+ int A = (struct{ int a;}){ 1}.a;
}
int test2(int a, int b) {
- return a ? a,b : a;
+ return a ? (void)a,b : a;
}
int test3(int a, int b, int c) {
@@ -22,23 +20,27 @@ int test3(int a, int b, int c) {
int test4() {
test4();
+ return 0;
}
+struct X0 { struct { struct { int c[10][9]; } b; } a; };
+
int test_offsetof() {
- // FIXME: change into something that is semantically correct.
- __builtin_offsetof(int, a.b.c[4][5]);
+ (void)__builtin_offsetof(struct X0, a.b.c[4][5]);
+ return 0;
}
void test_sizeof(){
int arr[10];
- sizeof arr[0];
- sizeof(arr[0]);
- sizeof(arr)[0];
+ (void)sizeof arr[0];
+ (void)sizeof(arr[0]);
+ (void)sizeof(arr)[0];
}
// PR3418
int test_leading_extension() {
__extension__ (*(char*)0) = 1;
+ return 0;
}
// PR3972
OpenPOWER on IntegriCloud