forked from facebook/hermes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
float-constant.js
31 lines (28 loc) · 1.1 KB
/
float-constant.js
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
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// RUN: %hermes -target=HBC -dump-bytecode -pretty-disassemble=true -O %s | %FileCheck --match-full-lines %s
var w = 3.14;
var x = -0.00056;
var y = 12345670.89;
var z = 0.0;
//CHECK-LABEL:Function<global>{{.*}}:
//CHECK-NEXT:Offset in debug table: source 0x0000, lexical 0x0000
//CHECK-NEXT: DeclareGlobalVar "w"
//CHECK-NEXT: DeclareGlobalVar "x"
//CHECK-NEXT: DeclareGlobalVar "y"
//CHECK-NEXT: DeclareGlobalVar "z"
//CHECK-NEXT: LoadConstDouble r0, 3.14
//CHECK-NEXT: GetGlobalObject r1
//CHECK-NEXT: PutById r1, r0, 1, "w"
//CHECK-NEXT: LoadConstDouble r0, -0.00056
//CHECK-NEXT: PutById r1, r0, 2, "x"
//CHECK-NEXT: LoadConstDouble r0, 12345670.89
//CHECK-NEXT: PutById r1, r0, 3, "y"
//CHECK-NEXT: LoadConstZero r0
//CHECK-NEXT: PutById r1, r0, 4, "z"
//CHECK-NEXT: LoadConstUndefined r0
//CHECK-NEXT: Ret r0