aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog8
-rw-r--r--gcc/testsuite/gcc.dg/Walways-true-1.c26
-rw-r--r--gcc/testsuite/gcc.dg/Werror-1.c4
-rw-r--r--gcc/testsuite/gcc.dg/c90-const-expr-5.c16
-rw-r--r--gcc/testsuite/gcc.dg/compare4.c6
-rw-r--r--gcc/testsuite/gcc.dg/misc-column.c29
6 files changed, 63 insertions, 26 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index e3215bd..4ec69d5 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2008-09-23 Aldy Hernandez <aldyh@redhat.com>
+
+ * gcc.dg/Walways-true-1.c: Test column numbers.
+ * gcc.dg/c90-const-expr-5.c: Same.
+ * gcc.dg/compare4.c: Same.
+ * gcc.dg/Werror-1.c: Same.
+
2008-09-23 Daniel Kraft <d@domob.eu>
PR fortran/37588
@@ -619,6 +626,7 @@
PR tree-optimization/37508
* gcc.dg/tree-ssa/pr37508.c: New testcase.
+>>>>>>> .r140590
2008-09-15 Aldy Hernandez <aldyh@redhat.com>
* g++.old-deja/g++.brendan/crash16.C: Function name is the correct
diff --git a/gcc/testsuite/gcc.dg/Walways-true-1.c b/gcc/testsuite/gcc.dg/Walways-true-1.c
index 299932f..32b921c 100644
--- a/gcc/testsuite/gcc.dg/Walways-true-1.c
+++ b/gcc/testsuite/gcc.dg/Walways-true-1.c
@@ -2,7 +2,7 @@
Origin: Ian Lance Taylor <iant@google.com>. */
/* { dg-do compile} */
-/* { dg-options "-Waddress" } */
+/* { dg-options "-Waddress -fshow-column" } */
extern int foo (int);
@@ -12,46 +12,46 @@ void
bar (int a)
{
lab:
- if (foo) /* { dg-warning "always evaluate as" "correct warning" } */
+ if (foo) /* { dg-warning "7:always evaluate as" "correct warning" } */
foo (0);
if (foo (1))
;
- if (&i) /* { dg-warning "always evaluate as" "correct warning" } */
+ if (&i) /* { dg-warning "7:always evaluate as" "correct warning" } */
foo (2);
if (i)
foo (3);
- if (&a) /* { dg-warning "always evaluate as" "correct warning" } */
+ if (&a) /* { dg-warning "7:always evaluate as" "correct warning" } */
foo (4);
if (a)
foo (5);
- if (&&lab) /* { dg-warning "always evaluate as" "correct warning" } */
+ if (&&lab) /* { dg-warning "7:always evaluate as" "correct warning" } */
foo (6);
- if (foo == 0) /* { dg-warning "never be NULL" "correct warning" } */
+ if (foo == 0) /* { dg-warning "11:never be NULL" "correct warning" } */
foo (7);
if (foo (1) == 0)
foo (8);
- if (&i == 0) /* { dg-warning "never be NULL" "correct warning" } */
+ if (&i == 0) /* { dg-warning "10:never be NULL" "correct warning" } */
foo (9);
if (i == 0)
foo (10);
- if (&a == 0) /* { dg-warning "never be NULL" "correct warning" } */
+ if (&a == 0) /* { dg-warning "10:never be NULL" "correct warning" } */
foo (11);
if (a == 0)
foo (12);
- if (&&lab == 0) /* { dg-warning "never be NULL" "correct warning" } */
+ if (&&lab == 0) /* { dg-warning "13:never be NULL" "correct warning" } */
foo (13);
- if (0 == foo) /* { dg-warning "never be NULL" "correct warning" } */
+ if (0 == foo) /* { dg-warning "9:never be NULL" "correct warning" } */
foo (14);
if (0 == foo (1))
foo (15);
- if (0 == &i) /* { dg-warning "never be NULL" "correct warning" } */
+ if (0 == &i) /* { dg-warning "9:never be NULL" "correct warning" } */
foo (16);
if (0 == i)
foo (17);
- if (0 == &a) /* { dg-warning "never be NULL" "correct warning" } */
+ if (0 == &a) /* { dg-warning "9:never be NULL" "correct warning" } */
foo (18);
if (0 == a)
foo (19);
- if (0 == &&lab) /* { dg-warning "never be NULL" "correct warning" } */
+ if (0 == &&lab) /* { dg-warning "9:never be NULL" "correct warning" } */
foo (20);
}
diff --git a/gcc/testsuite/gcc.dg/Werror-1.c b/gcc/testsuite/gcc.dg/Werror-1.c
index 815a561..001af24 100644
--- a/gcc/testsuite/gcc.dg/Werror-1.c
+++ b/gcc/testsuite/gcc.dg/Werror-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-Waddress -Wattributes -Werror" } */
+/* { dg-options "-Waddress -Wattributes -Werror -fshow-column" } */
/* { dg-message "warnings being treated as errors" "" {target "*-*-*"} 0 } */
/* This is the first in a series of test cases that test the
@@ -16,6 +16,6 @@ int i;
void
foo ()
{
- if (&i) /* { dg-error ".* will always evaluate as 'true'" } */
+ if (&i) /* { dg-error "7:.* will always evaluate as 'true'" } */
grill ();
}
diff --git a/gcc/testsuite/gcc.dg/c90-const-expr-5.c b/gcc/testsuite/gcc.dg/c90-const-expr-5.c
index ca72508..0a5af81 100644
--- a/gcc/testsuite/gcc.dg/c90-const-expr-5.c
+++ b/gcc/testsuite/gcc.dg/c90-const-expr-5.c
@@ -2,7 +2,7 @@
qualified void. */
/* Origin: Joseph Myers <joseph@codesourcery.com> */
/* { dg-do compile } */
-/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors -fshow-column" } */
typedef void V;
int *p;
@@ -15,14 +15,14 @@ f (void)
{
/* (V *)0 is a null pointer constant, so the assignment should be
diagnosed. */
- q = (j ? p : (V *)0); /* { dg-error "assignment from incompatible pointer type" } */
- q = (j ? p : (void *)0); /* { dg-error "assignment from incompatible pointer type" } */
+ q = (j ? p : (V *)0); /* { dg-error "3:assignment from incompatible pointer type" } */
+ q = (j ? p : (void *)0); /* { dg-error "3:assignment from incompatible pointer type" } */
/* And this conversion should be valid. */
(void (*)(void))(V *)0;
(void (*)(void))(void *)0;
/* Pointers to qualified void are not valid null pointer
constants. */
- fp = (const void *)0; /* { dg-error "ISO C forbids assignment between function pointer and 'void \\*'" } */
+ fp = (const void *)0; /* { dg-error "3:ISO C forbids assignment between function pointer and 'void \\*'" } */
fp = (void *)0;
fp = (V *)0;
fp = 0;
@@ -32,8 +32,8 @@ f (void)
(void *)0 == fp;
fp == (V *)0;
(V *)0 == fp;
- fp == (V *)1; /* { dg-error "ISO C forbids comparison of 'void \\*' with function pointer" } */
- (V *)1 == fp; /* { dg-error "ISO C forbids comparison of 'void \\*' with function pointer" } */
- fp == (const void *)0; /* { dg-error "ISO C forbids comparison of 'void \\*' with function pointer" } */
- (const void *)0 == fp; /* { dg-error "ISO C forbids comparison of 'void \\*' with function pointer" } */
+ fp == (V *)1; /* { dg-error "6:ISO C forbids comparison of 'void \\*' with function pointer" } */
+ (V *)1 == fp; /* { dg-error "10:ISO C forbids comparison of 'void \\*' with function pointer" } */
+ fp == (const void *)0; /* { dg-error "6:ISO C forbids comparison of 'void \\*' with function pointer" } */
+ (const void *)0 == fp; /* { dg-error "19:ISO C forbids comparison of 'void \\*' with function pointer" } */
}
diff --git a/gcc/testsuite/gcc.dg/compare4.c b/gcc/testsuite/gcc.dg/compare4.c
index aae7cbe..e5dad4d 100644
--- a/gcc/testsuite/gcc.dg/compare4.c
+++ b/gcc/testsuite/gcc.dg/compare4.c
@@ -2,7 +2,7 @@
Origin: Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 5/13/2001. */
/* { dg-do compile } */
-/* { dg-options "-Wsign-compare -fstrict-overflow" } */
+/* { dg-options "-fshow-column -Wsign-compare -fstrict-overflow" } */
extern void bar(void);
@@ -10,7 +10,7 @@ int foo(int x, int y, unsigned u)
{
/* A COMPOUND_EXPR is non-negative if the last element is known to
be non-negative. */
- if (u < (bar(), -1)) /*{ dg-warning "signed and unsigned" "COMPOUND_EXPR" }*/
+ if (u < (bar(), -1)) /*{ dg-warning "9:signed and unsigned" "COMPOUND_EXPR" }*/
return x;
if (u < (bar(), 10))
return x;
@@ -34,7 +34,7 @@ int foo(int x, int y, unsigned u)
/* A MODIFY_EXPR is non-negative if the new value is known to be
non-negative. */
- if (u < (x = -1)) /* { dg-warning "signed and unsigned" "MODIFY_EXPR" } */
+ if (u < (x = -1)) /* { dg-warning "9:signed and unsigned" "MODIFY_EXPR" } */
return x;
if (u < (x = 10))
return x;
diff --git a/gcc/testsuite/gcc.dg/misc-column.c b/gcc/testsuite/gcc.dg/misc-column.c
new file mode 100644
index 0000000..f84a553
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/misc-column.c
@@ -0,0 +1,29 @@
+/* { dg-options "-fshow-column -Wall -Wfloat-equal -pedantic" } */
+
+float a, b;
+
+int *p;
+struct {
+ int a;
+ char b;
+} *q;
+
+extern void bar();
+
+void foo (void)
+{
+ if (a == b) /* { dg-warning "9:comparing floating point with" } */
+ bar ();
+
+ if (p < q) /* { dg-warning "9:comparison of distinct pointer types" } */
+ bar ();
+
+ if (&p == 0) /* { dg-warning "10:will never be NULL" } */
+ bar();
+
+ if (p == 4) /* { dg-warning "9:comparison between pointer and integer" } */
+ bar();
+
+ if (p < 0) /* { dg-warning "9:ordered comparison of pointer with" } */
+ bar();
+}