Browse Source

+ tbs0182 from bug0182

pierre 27 years ago
parent
commit
18acc6d871
1 changed files with 31 additions and 0 deletions
  1. 31 0
      tests/tbs0182.pp

+ 31 - 0
tests/tbs0182.pp

@@ -0,0 +1,31 @@
+TYPE Rec = RECORD
+             x:WORD;
+             y:WORD;
+           END;
+ 
+     Rec1 = Record
+            x,y : longint;
+            end;
+     Rec2 = Record
+            r,s : Rec1;
+            z : word;
+            end;
+     plongint = ^longint;
+            
+VAR s:WORD;
+    r:Rec;
+    rr : Rec2;
+ 
+CONST p1:POINTER = @s;    { Works fine }
+      p2:POINTER = @R.y;  { illegal expression }
+      p3:pointer = @rr.s.y;
+      p4:plongint = @rr.s.y;
+BEGIN
+   rr.s.y:=15;
+   if plongint(p3)^<>15 then
+     Begin
+        Writeln('Error : wrong code generated');
+        Halt(1);
+     End;
+END.
+