@@ -18,14 +18,6 @@ template<typename T> __attribute__((noinline)) void use(T x) {
18
18
/* Clobbers */ : " rsi" \
19
19
);
20
20
21
- // Destroy %rbx in the current frame.
22
- #define DESTROY_RBX \
23
- asm volatile (" xorq %%rbx, %%rbx" \
24
- /* Outputs */ : \
25
- /* Inputs */ : \
26
- /* Clobbers */ : " rbx" \
27
- );
28
-
29
21
struct S1 {
30
22
int field1 = 123 ;
31
23
int *field2 = &field1;
@@ -38,17 +30,10 @@ void func1(int &sink, int x) {
38
30
// Destroy 'x' in the current frame.
39
31
DESTROY_RSI;
40
32
41
- // NOTE: Currently, we do not generate DW_OP_entry_value for the 'x',
42
- // since it gets copied into a register that is not callee saved,
43
- // and we can not guarantee that its value has not changed.
33
+ // % self.filecheck("image lookup -va $pc", "main.cpp", "-check-prefix=FUNC1-DESC")
34
+ // FUNC1-DESC: name = "x", type = "int", location = DW_OP_entry_value(DW_OP_reg4 RSI)
44
35
45
36
++sink;
46
-
47
- // Destroy 'sink' in the current frame.
48
- DESTROY_RBX;
49
-
50
- // % self.filecheck("image lookup -va $pc", "main.cpp", "-check-prefix=FUNC1-DESC")
51
- // FUNC1-DESC: name = "sink", type = "int &", location = DW_OP_entry_value(DW_OP_reg5 RDI)
52
37
}
53
38
54
39
__attribute__ ((noinline))
@@ -58,16 +43,10 @@ void func2(int &sink, int x) {
58
43
// Destroy 'x' in the current frame.
59
44
DESTROY_RSI;
60
45
61
- // % self.filecheck("expr x", "main.cpp", "-check-prefix=FUNC2-EXPR-FAIL", expect_cmd_failure=True )
62
- // FUNC2-EXPR-FAIL: couldn't get the value of variable x: variable not available
46
+ // % self.filecheck("expr x", "main.cpp", "-check-prefix=FUNC2-EXPR" )
47
+ // FUNC2-EXPR: (int) ${{.*}} = 123
63
48
64
49
++sink;
65
-
66
- // Destroy 'sink' in the current frame.
67
- DESTROY_RBX;
68
-
69
- // % self.filecheck("expr sink", "main.cpp", "-check-prefix=FUNC2-EXPR")
70
- // FUNC2-EXPR: ${{.*}} = 2
71
50
}
72
51
73
52
__attribute__ ((noinline))
@@ -90,16 +69,10 @@ void func4_amb(int &sink, int x) {
90
69
// Destroy 'x' in the current frame.
91
70
DESTROY_RSI;
92
71
93
- // % self.filecheck("expr x", "main.cpp", "-check-prefix=FUNC4-EXPR-FAIL ", expect_cmd_failure=True)
94
- // FUNC4-EXPR-FAIL : couldn't get the value of variable x: variable not available
72
+ // % self.filecheck("expr x", "main.cpp", "-check-prefix=FUNC4-EXPR", expect_cmd_failure=True)
73
+ // FUNC4-EXPR: couldn't get the value of variable x: Could not evaluate DW_OP_entry_value.
95
74
96
75
++sink;
97
-
98
- // Destroy 'sink' in the current frame.
99
- DESTROY_RBX;
100
-
101
- // % self.filecheck("expr sink", "main.cpp", "-check-prefix=FUNC4-EXPR", expect_cmd_failure=True)
102
- // FUNC4-EXPR: couldn't get the value of variable sink: Could not evaluate DW_OP_entry_value.
103
76
}
104
77
105
78
__attribute__ ((noinline))
@@ -125,16 +98,10 @@ void func7(int &sink, int x) {
125
98
// Destroy 'x' in the current frame.
126
99
DESTROY_RSI;
127
100
128
- // % self.filecheck("expr x", "main.cpp", "-check-prefix=FUNC7-EXPR-FAIL", expect_cmd_failure=True )
129
- // FUNC7-EXPR-FAIL: couldn't get the value of variable x: variable not available
101
+ // % self.filecheck("expr x", "main.cpp", "-check-prefix=FUNC7-EXPR" )
102
+ // FUNC7-EXPR: (int) ${{.*}} = 123
130
103
131
104
++sink;
132
-
133
- // Destroy 'sink' in the current frame.
134
- DESTROY_RBX;
135
-
136
- // % self.filecheck("expr sink", "main.cpp", "-check-prefix=FUNC7-EXPR")
137
- // FUNC7-EXPR: ${{.*}} = 4
138
105
}
139
106
140
107
__attribute__ ((always_inline))
@@ -162,16 +129,10 @@ void func11_tailcalled(int &sink, int x) {
162
129
// Destroy 'x' in the current frame.
163
130
DESTROY_RSI;
164
131
165
- // % self.filecheck("expr x", "main.cpp", "-check-prefix=FUNC11-EXPR-FAIL", expect_cmd_failure=True )
166
- // FUNC11-EXPR-FAIL: couldn't get the value of variable x: variable not available
132
+ // % self.filecheck("expr x", "main.cpp", "-check-prefix=FUNC11-EXPR" )
133
+ // FUNC11-EXPR: (int) ${{.*}} = 123
167
134
168
135
++sink;
169
-
170
- // Destroy 'sink' in the current frame.
171
- DESTROY_RBX;
172
-
173
- // % self.filecheck("expr sink", "main.cpp", "-check-prefix=FUNC11-EXPR")
174
- // FUNC11-EXPR: ${{.*}} = 5
175
136
}
176
137
177
138
__attribute__ ((noinline))
@@ -189,16 +150,10 @@ void func13(int &sink, int x) {
189
150
// Destroy 'x' in the current frame.
190
151
DESTROY_RSI;
191
152
192
- // % self.filecheck("expr x", "main.cpp", "-check-prefix=FUNC13-EXPR-FAIL", expect_cmd_failure=True)
193
- // FUNC13-EXPR-FAIL: couldn't get the value of variable x: variable not available
194
-
195
- use (sink);
153
+ // % self.filecheck("expr x", "main.cpp", "-check-prefix=FUNC13-EXPR")
154
+ // FUNC13-EXPR: (int) ${{.*}} = 123
196
155
197
- // Destroy 'sink' in the current frame.
198
- DESTROY_RBX;
199
-
200
- // % self.filecheck("expr sink", "main.cpp", "-check-prefix=FUNC13-EXPR")
201
- // FUNC13-EXPR: ${{.*}} = 5
156
+ ++sink;
202
157
}
203
158
204
159
__attribute__ ((noinline, disable_tail_calls))
0 commit comments