From: Chris Lattner Date: Fri, 12 Dec 2008 07:01:24 +0000 (+0000) Subject: merge these testcases into one file. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=04de9937d861105a7bb21f88b89705537f2663b7;p=clang merge these testcases into one file. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60936 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Sema/i-c-e.c b/test/Sema/i-c-e.c new file mode 100644 index 0000000000..30cc9e2dd2 --- /dev/null +++ b/test/Sema/i-c-e.c @@ -0,0 +1,35 @@ +// RUN: clang %s -fsyntax-only -verify -pedantic -fpascal-strings + +int a() {int p; *(1 ? &p : (void*)(0 && (a(),1))) = 10;} + +// rdar://6091492 - ?: with __builtin_constant_p as the operand is an i-c-e. +int expr; +char w[__builtin_constant_p(expr) ? expr : 1]; + + + +void test1(int n, int* p) { *(n ? p : (void *)(7-7)) = 1; } +void test2(int n, int* p) { *(n ? p : (void *)0) = 1; } + + + +char array[1024/(sizeof (long))]; + +int x['\xBb' == (char) 187 ? 1: -1]; + +// PR1992 +void func(int x) +{ + switch (x) { + case sizeof("abc"): break; + case sizeof("loooong"): func(4); + case sizeof("\ploooong"): func(4); + } +} + + +// rdar://4213768 +int expr; +char y[__builtin_constant_p(expr) ? -1 : 1]; +char z[__builtin_constant_p(4) ? 1 : -1]; + diff --git a/test/Sema/i-c-e1.c b/test/Sema/i-c-e1.c deleted file mode 100644 index cb4a9a33af..0000000000 --- a/test/Sema/i-c-e1.c +++ /dev/null @@ -1,5 +0,0 @@ -// RUN: clang %s -fsyntax-only - -void test1(int n, int* p) { *(n ? p : (void *)(7-7)) = 1; } -void test2(int n, int* p) { *(n ? p : (void *)0) = 1; } - diff --git a/test/Sema/i-c-e2.c b/test/Sema/i-c-e2.c deleted file mode 100644 index 587fcabbfb..0000000000 --- a/test/Sema/i-c-e2.c +++ /dev/null @@ -1,22 +0,0 @@ -// RUN: clang %s -fsyntax-only -fpascal-strings - -char array[1024/(sizeof (long))]; - -int x['\xBb' == (char) 187 ? 1: -1]; - -// PR1992 -void func(int x) -{ - switch (x) { - case sizeof("abc"): break; - case sizeof("loooong"): func(4); - case sizeof("\ploooong"): func(4); - } -} - - -// rdar://4213768 -int expr; -char y[__builtin_constant_p(expr) ? -1 : 1]; -char z[__builtin_constant_p(4) ? 1 : -1]; - diff --git a/test/Sema/i-c-e3.c b/test/Sema/i-c-e3.c deleted file mode 100644 index e6e67d643d..0000000000 --- a/test/Sema/i-c-e3.c +++ /dev/null @@ -1,8 +0,0 @@ -// RUN: clang %s -fsyntax-only -verify -pedantic - -int a() {int p; *(1 ? &p : (void*)(0 && (a(),1))) = 10;} - -// rdar://6091492 - ?: with __builtin_constant_p as the operand is an i-c-e. -int expr; -char w[__builtin_constant_p(expr) ? expr : 1]; -