forked from chakra-core/ChakraCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathif-test.js
More file actions
46 lines (40 loc) · 1.01 KB
/
if-test.js
File metadata and controls
46 lines (40 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
WScript.LoadScriptFile("..\\UnitTestFramework\\SimdJsHelpers.js");
function func1(c, d, e)
{
var x;
var i =0;
if (c == true)
{
x = SIMD.Int32x4(1, 2.0, 3, 4);
}
else
{
x = SIMD.Float32x4(5, 6.5, 7, 8.5);
}
for (i = 0; i < 10; i++)
{
if (d == true)
{
return SIMD.Int32x4.add(x, x);
}
else
{
return SIMD.Float32x4.add(x, x);
}
}
}
var c = true;
var d = true;
var z;
for (i = 0; i < 100; i++)
{
z = func1(c, d);
c = !c;
d = !d;
}
equalSimd([10.0,13.0,14.0,17.0], z, SIMD.Float32x4, "func1");
print("PASS");