]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* gnat.dg/opt29.ad[sb]: New test.
authorEric Botcazou <ebotcazou@adacore.com>
Fri, 29 Nov 2013 12:16:07 +0000 (12:16 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Fri, 29 Nov 2013 12:16:07 +0000 (12:16 +0000)
From-SVN: r205523

gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/opt29.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/opt29.ads [new file with mode: 0644]

index 411d5e963aa2550d7d3b5fc07764889ced896ffd..713980f5328406126515a6dcb772706fe0f25991 100644 (file)
@@ -1,3 +1,7 @@
+2013-11-29  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gnat.dg/opt29.ad[sb]: New test.
+
 2013-11-29  Richard Biener  <rguenther@suse.de>
 
        PR middle-end/59338
diff --git a/gcc/testsuite/gnat.dg/opt29.adb b/gcc/testsuite/gnat.dg/opt29.adb
new file mode 100644 (file)
index 0000000..64f2bae
--- /dev/null
@@ -0,0 +1,13 @@
+-- { dg-do compile }\r
+-- { dg-options "-O" }\r
+\r
+package body Opt29 is\r
+\r
+  procedure Proc (T : Rec) is\r
+  begin\r
+    if Derived2 (T.F2.all).Id = T.F1.Id then\r
+      raise Program_Error;\r
+    end if;\r
+  end;\r
+\r
+end Opt29;\r
diff --git a/gcc/testsuite/gnat.dg/opt29.ads b/gcc/testsuite/gnat.dg/opt29.ads
new file mode 100644 (file)
index 0000000..c809b1c
--- /dev/null
@@ -0,0 +1,28 @@
+package Opt29 is\r
+\r
+  type Word is mod 2**16;\r
+\r
+  type PID is record\r
+    W1, W2: Word;\r
+  end record;\r
+\r
+  type Root1 is tagged record\r
+    Id: PID;\r
+  end record;\r
+  type Root1_Ptr is access all Root1'Class;\r
+\r
+  type Root2 is tagged null record;\r
+  type Root2_Ptr is access all Root2'class;\r
+\r
+  type Derived2 is new Root2 with record\r
+    Id: PID;\r
+  end record;\r
+\r
+  type Rec is record\r
+    F1: Root1_Ptr;\r
+    F2: Root2_Ptr;\r
+  end record;\r
+\r
+  procedure Proc (T : Rec);\r
+\r
+end Opt29;\r