OSDN Git Service

* gcc.dg/noncompile/label-lineno-1.c: New test.
authorghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 23 Aug 2000 21:12:15 +0000 (21:12 +0000)
committerghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 23 Aug 2000 21:12:15 +0000 (21:12 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@35924 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/noncompile/label-lineno-1.c [new file with mode: 0644]

index 615c599..1861b98 100644 (file)
@@ -1,3 +1,7 @@
+2000-08-23  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+       * gcc.dg/noncompile/label-lineno-1.c: New test.
+
 2000-08-23  Joseph S. Myers  <jsm28@cam.ac.uk>
 
        * gcc.dg/c99-array-nonobj-1.c: New test.
diff --git a/gcc/testsuite/gcc.dg/noncompile/label-lineno-1.c b/gcc/testsuite/gcc.dg/noncompile/label-lineno-1.c
new file mode 100644 (file)
index 0000000..8274117
--- /dev/null
@@ -0,0 +1,14 @@
+/* Ensure that diagnostics for labels appear on the correct lineno.
+   by Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 8/23/2000.  */
+
+int
+foo(int i)
+{
+ my_label:
+
+  i++;
+
+ my_label: /* { dg-error "duplicate label" "label lineno" } */
+
+  i++;
+}