Quellcode durchsuchen

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

git-svn-id: trunk@4290 -

Jonas Maebe vor 19 Jahren
Ursprung
Commit
5bf38351e9
3 geänderte Dateien mit 20 neuen und 2 gelöschten Zeilen
  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/tw7143.pp -text
 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/ub1883.pp svneol=native#text/plain
 tests/webtbs/uw0555.pp svneol=native#text/plain

+ 2 - 2
compiler/ninl.pas

@@ -2485,7 +2485,7 @@ implementation
       begin
         { create the call to the helper }
         { 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);
         left := nil;
       end;
@@ -2494,7 +2494,7 @@ implementation
       begin
         { create the call to the helper }
         { 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);
         left := nil;
       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.
+