Procházet zdrojové kódy

* r42239 broke the tw13948b test for aarch64. Fixed this and improved the test.

git-svn-id: trunk@44052 -
yury před 5 roky
rodič
revize
4a756a2d30
2 změnil soubory, kde provedl 14 přidání a 3 odebrání
  1. 7 3
      compiler/ncgmem.pas
  2. 7 0
      tests/webtbs/tw13948b.pp

+ 7 - 3
compiler/ncgmem.pas

@@ -944,9 +944,13 @@ implementation
                LOC_REGISTER:
                  begin
                    if not(is_constnode(right)) or (tarraydef(left.resultdef).elementdef.size<>alusinttype.size) then
-                     hlcg.location_force_mem(current_asmdata.CurrAsmList,left.location,left.resultdef);
-                   { we use location here only to get the right offset }
-                   location_reset_ref(location,LOC_REFERENCE,OS_NO,1,[]);
+                     begin
+                       hlcg.location_force_mem(current_asmdata.CurrAsmList,left.location,left.resultdef);
+                       location_copy(location,left.location);
+                     end
+                   else
+                     { we use location here only to get the right offset }
+                     location_reset_ref(location,LOC_REFERENCE,OS_NO,1,[]);
                  end;
                LOC_CSUBSETREG,
                LOC_CMMREGISTER,

+ 7 - 0
tests/webtbs/tw13948b.pp

@@ -22,6 +22,13 @@ begin
     halt(1);
   if (r[1]<>2) then
     halt(2);
+  r[0]:=f[1];
+  writeln(r[0]);
+  writeln(r[1]);
+  if (r[0]<>6) then
+    halt(1);
+  if (r[1]<>2) then
+    halt(2);
 end;
 
 begin