Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit a117f99

Browse files
author
Dylan McKay
committed
[emscripten] Fix test which failed due to DCE
Dead code elimination would remove a bunch of math calls.
1 parent c37b5f4 commit a117f99

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

test/CodeGen/JS/ffis-f32.ll

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128"
66
target triple = "asmjs-unknown-emscripten"
77

8+
declare void @blackbox.float(float %a)
9+
declare void @blackbox.double(double %a)
10+
811
; CHECK: (+Math_sqrt(+1));
912
; CHECK-NEXT: (Math_fround(Math_sqrt(Math_fround(+1))));
1013
; CHECK-NEXT: (+Math_sqrt((+$d)));
@@ -53,6 +56,12 @@ entry:
5356
%sind = call double @sin(double 1.0)
5457
%sinf = call float @sinf(float 1.0)
5558

59+
call void @blackbox.float(float %sqrtf)
60+
call void @blackbox.double(double %sqrtd)
61+
62+
call void @blackbox.float(float %sinf)
63+
call void @blackbox.double(double %sind)
64+
5665
ret void
5766
}
5867

test/CodeGen/JS/ffis.ll

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128"
66
target triple = "asmjs-unknown-emscripten"
77

8+
declare void @blackbox.float(float %a)
9+
declare void @blackbox.double(double %a)
10+
811
; CHECK: (+Math_sqrt(+1));
912
; CHECK-NEXT: (+Math_sqrt(+1));
1013
; CHECK-NEXT: (+Math_sqrt((+$d)));
@@ -53,6 +56,12 @@ entry:
5356
%sind = call double @sin(double 1.0)
5457
%sinf = call float @sinf(float 1.0)
5558

59+
call void @blackbox.float(float %sqrtf)
60+
call void @blackbox.double(double %sqrtd)
61+
62+
call void @blackbox.float(float %sinf)
63+
call void @blackbox.double(double %sind)
64+
5665
ret void
5766
}
5867

0 commit comments

Comments
 (0)