forked from facebook/hermes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsequence.js
More file actions
48 lines (42 loc) · 1.41 KB
/
sequence.js
File metadata and controls
48 lines (42 loc) · 1.41 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
47
/**
* 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 -hermes-parser -dump-ir %s -O0 | %FileCheck %s --match-full-lines
// RUN: %hermes -hermes-parser -dump-ir %s -O
function sink0(a) { }
function sink1(a) { }
//CHECK: function test1(x, y)
//CHECK: frame = [x, y]
//CHECK: %BB0:
//CHECK: %0 = StoreFrameInst %x, [x]
//CHECK: %1 = StoreFrameInst %y, [y]
//CHECK: %2 = ReturnInst 3 : number
//CHECK: %BB1:
//CHECK: %3 = ReturnInst undefined : undefined
//CHECK: function_end
function test1(x,y) {
return (1,2,3);
}
//CHECK: function test2(x, y)
//CHECK: frame = [x, y]
//CHECK: %BB0:
//CHECK: %0 = StoreFrameInst %x, [x]
//CHECK: %1 = StoreFrameInst %y, [y]
//CHECK: %2 = LoadPropertyInst globalObject : object, "sink0" : string
//CHECK: %3 = LoadFrameInst [x]
//CHECK: %4 = LoadFrameInst [y]
//CHECK: %5 = CallInst %2, undefined : undefined, %3, %4
//CHECK: %6 = LoadPropertyInst globalObject : object, "sink1" : string
//CHECK: %7 = LoadFrameInst [x]
//CHECK: %8 = LoadFrameInst [y]
//CHECK: %9 = CallInst %6, undefined : undefined, %7, %8
//CHECK: %10 = ReturnInst %9
//CHECK: %BB1:
//CHECK: %11 = ReturnInst undefined : undefined
//CHECK: function_end
function test2(x,y) {
return (sink0(x,y), sink1(x,y));
}