瀏覽代碼

* fixed bug #7195: use regular type conversions for the results of
fpc_sqr(t)_real

git-svn-id: trunk@4290 -

Jonas Maebe 19 年之前
父節點
當前提交
5bf38351e9
共有 3 個文件被更改,包括 20 次插入2 次删除
  1. 1 0
      .gitattributes
  2. 2 2
      compiler/ninl.pas
  3. 17 0
      tests/webtbs/tw7195.pp

+ 1 - 0
.gitattributes

@@ -7230,6 +7230,7 @@ tests/webtbs/tw7100.pp svneol=native#text/plain
 tests/webtbs/tw7104.pp svneol=native#text/plain
 tests/webtbs/tw7104.pp svneol=native#text/plain
 tests/webtbs/tw7143.pp -text
 tests/webtbs/tw7143.pp -text
 tests/webtbs/tw7161.pp svneol=native#text/plain
 tests/webtbs/tw7161.pp svneol=native#text/plain
+tests/webtbs/tw7195.pp svneol=native#text/plain
 tests/webtbs/ub1873.pp svneol=native#text/plain
 tests/webtbs/ub1873.pp svneol=native#text/plain
 tests/webtbs/ub1883.pp svneol=native#text/plain
 tests/webtbs/ub1883.pp svneol=native#text/plain
 tests/webtbs/uw0555.pp svneol=native#text/plain
 tests/webtbs/uw0555.pp svneol=native#text/plain

+ 2 - 2
compiler/ninl.pas

@@ -2485,7 +2485,7 @@ implementation
       begin
       begin
         { create the call to the helper }
         { create the call to the helper }
         { on entry left node contains the parameter }
         { on entry left node contains the parameter }
-        first_sqr_real := ctypeconvnode.create_internal(ccallnode.createintern('fpc_sqr_real',
+        first_sqr_real := ctypeconvnode.create(ccallnode.createintern('fpc_sqr_real',
                 ccallparanode.create(left,nil)),resulttype);
                 ccallparanode.create(left,nil)),resulttype);
         left := nil;
         left := nil;
       end;
       end;
@@ -2494,7 +2494,7 @@ implementation
       begin
       begin
         { create the call to the helper }
         { create the call to the helper }
         { on entry left node contains the parameter }
         { on entry left node contains the parameter }
-        first_sqrt_real := ctypeconvnode.create_internal(ccallnode.createintern('fpc_sqrt_real',
+        first_sqrt_real := ctypeconvnode.create(ccallnode.createintern('fpc_sqrt_real',
                 ccallparanode.create(left,nil)),resulttype);
                 ccallparanode.create(left,nil)),resulttype);
         left := nil;
         left := nil;
       end;
       end;

+ 17 - 0
tests/webtbs/tw7195.pp

@@ -0,0 +1,17 @@
+{$mode delphi}
+
+Function Test(S : single) : single;
+begin
+  Result := sqrt(s);
+end;
+
+Function Test2(S : single) : single;
+begin
+  Result := sqr(s);
+end;
+
+begin
+ writeln(Test(0.123445));
+ writeln(Test2(0.123445));
+end.
+