summaryrefslogtreecommitdiffstats
path: root/clang/test/Parser
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-01-04 18:04:52 +0000
committerChris Lattner <sabre@nondot.org>2008-01-04 18:04:52 +0000
commit9bad62c72a2070806976d5b22e79f7f85de69536 (patch)
tree9cbf97ccf6941a34025c1ad5d0bd2faa5cec5370 /clang/test/Parser
parentd98c63ebb92eb721a7958081e8dd4384a9d131dc (diff)
downloadbcm5719-llvm-9bad62c72a2070806976d5b22e79f7f85de69536.tar.gz
bcm5719-llvm-9bad62c72a2070806976d5b22e79f7f85de69536.zip
Merge all the 'assignment' diagnostic code into one routine, decloning
it from several places. This merges the diagnostics, making them more uniform and fewer in number. This also simplifies and cleans up the code. Some highlights: 1. This removes a bunch of very-similar diagnostics. 2. This renames AssignmentCheckResult -> AssignConvertType 3. This merges PointerFromInt + IntFromPointer which were always treated the same. 4. This updates a bunch of test cases that have minor changes to the produced diagnostics. llvm-svn: 45589
Diffstat (limited to 'clang/test/Parser')
-rw-r--r--clang/test/Parser/builtin_types_compatible.c2
-rw-r--r--clang/test/Parser/implicit-casts.c4
-rw-r--r--clang/test/Parser/typeof.c4
3 files changed, 3 insertions, 7 deletions
diff --git a/clang/test/Parser/builtin_types_compatible.c b/clang/test/Parser/builtin_types_compatible.c
index b8207841a43..925c7ea50a1 100644
--- a/clang/test/Parser/builtin_types_compatible.c
+++ b/clang/test/Parser/builtin_types_compatible.c
@@ -35,7 +35,7 @@ static void test()
struct xx { int a; } x, y;
c = __builtin_choose_expr(a+3-7, b, x); // expected-error{{'__builtin_choose_expr' requires a constant expression}}
- c = __builtin_choose_expr(0, b, x); // expected-error{{incompatible types assigning 'struct xx' to 'int'}}
+ c = __builtin_choose_expr(0, b, x); // expected-error{{incompatible type assigning 'struct xx', expected 'int'}}
c = __builtin_choose_expr(5+3-7, b, x);
y = __builtin_choose_expr(4+3-7, b, x);
diff --git a/clang/test/Parser/implicit-casts.c b/clang/test/Parser/implicit-casts.c
index a07155eea40..3d055263bcb 100644
--- a/clang/test/Parser/implicit-casts.c
+++ b/clang/test/Parser/implicit-casts.c
@@ -1,4 +1,4 @@
-// RUN: clang -fsyntax-only -verify %s
+// RUN: clang -fsyntax-only -verify -pedantic %s
_Complex double X;
void test1(int c) {
X = 5;
@@ -14,7 +14,7 @@ void test2() {
}
int test3() {
int a[2];
- a[0] = test3; // expected-warning{{incompatible types assigning 'int (void)' to 'int'}}
+ a[0] = test3; // expected-warning{{incompatible pointer/int conversion assigning 'int (void)', expected 'int'}}
}
short x; void test4(char c) { x += c; }
int y; void test5(char c) { y += c; }
diff --git a/clang/test/Parser/typeof.c b/clang/test/Parser/typeof.c
index 6c4e79cd161..3ea277559e0 100644
--- a/clang/test/Parser/typeof.c
+++ b/clang/test/Parser/typeof.c
@@ -16,8 +16,4 @@ static void test() {
const typeof (*pi) aConstInt;
int xx;
int *i;
- i = aci; // expected-warning{{incompatible types assigning 'typeof(int const)' to 'int *'}}
- i = anInt; // expected-warning{{incompatible types assigning 'typeof(TInt)' to 'int *'}}
- i = aConstInt; // expected-warning{{incompatible types assigning 'typeof(*pi) const' to 'int *'}}
- i = xx; // expected-warning{{incompatible types assigning 'int' to 'int *'}}
}
OpenPOWER on IntegriCloud