From 36c49e3f258dced101949edabd72e9bc3f1dedc4 Mon Sep 17 00:00:00 2001 From: dim Date: Fri, 17 Sep 2010 15:54:40 +0000 Subject: Vendor import of clang r114020 (from the release_28 branch): http://llvm.org/svn/llvm-project/cfe/branches/release_28@114020 Approved by: rpaulo (mentor) --- test/Parser/expressions.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'test/Parser/expressions.c') 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 -- cgit v1.1