diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-07-26 04:08:02 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-07-26 04:08:02 +0000 |
commit | 67ca40c4197acc6a36e1e9139dc8fc608b2e6a44 (patch) | |
tree | ef382a300ed016c943d8f3c68ffd1a8bad1f3187 /clang/test/Parser/expressions.c | |
parent | 675b1625129cbd772143e66223c0a8ab67945285 (diff) | |
download | bcm5719-llvm-67ca40c4197acc6a36e1e9139dc8fc608b2e6a44.tar.gz bcm5719-llvm-67ca40c4197acc6a36e1e9139dc8fc608b2e6a44.zip |
Eliminate the "minimal" and printing parser actions, which only ever
worked for C anyway. Also kills the -cc1 options -parse-noop and
-parse-print-callbacks.
llvm-svn: 109392
Diffstat (limited to 'clang/test/Parser/expressions.c')
-rw-r--r-- | clang/test/Parser/expressions.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/clang/test/Parser/expressions.c b/clang/test/Parser/expressions.c index 44ebe661bef..ffc5c83a0a7 100644 --- a/clang/test/Parser/expressions.c +++ b/clang/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 |