forked from facebook/hermes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstance_of.js
More file actions
30 lines (27 loc) · 1.11 KB
/
instance_of.js
File metadata and controls
30 lines (27 loc) · 1.11 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
/**
* 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 -dump-ra %s -O0 | %FileCheck %s --match-full-lines
// RUN: %hermes -dump-ra %s -O
//CHECK-LABEL:function simple_test0(x, y)
//CHECK-NEXT:frame = [x, y]
//CHECK-NEXT:%BB0:
//CHECK-NEXT: {{.*}} %0 = HBCCreateEnvironmentInst
//CHECK-NEXT: {{.*}} %1 = HBCLoadParamInst 1 : number
//CHECK-NEXT: {{.*}} %2 = HBCLoadParamInst 2 : number
//CHECK-NEXT: {{.*}} %3 = HBCLoadConstInst undefined : undefined
//CHECK-NEXT: {{.*}} %4 = HBCStoreToEnvironmentInst %0, %1, [x]
//CHECK-NEXT: {{.*}} %5 = HBCStoreToEnvironmentInst %0, %2, [y]
//CHECK-NEXT: {{.*}} %6 = HBCLoadFromEnvironmentInst %0, [x]
//CHECK-NEXT: {{.*}} %7 = HBCLoadFromEnvironmentInst %0, [y]
//CHECK-NEXT: {{.*}} %8 = BinaryOperatorInst 'instanceof', %6, %7
//CHECK-NEXT: {{.*}} %9 = ReturnInst %8
//CHECK-NEXT:%BB1:
//CHECK-NEXT: $??? %10 = ReturnInst %3 : undefined
//CHECK-NEXT:function_end
function simple_test0(x, y) {
return x instanceof y;
}