@@ -18,14 +18,6 @@ template<typename T> __attribute__((noinline)) void use(T x) {
1818 /* Clobbers */ : " rsi" \
1919 );
2020
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-
2921struct S1 {
3022 int field1 = 123 ;
3123 int *field2 = &field1;
@@ -38,17 +30,10 @@ void func1(int &sink, int x) {
3830 // Destroy 'x' in the current frame.
3931 DESTROY_RSI;
4032
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)
4435
4536 ++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)
5237}
5338
5439__attribute__ ((noinline))
@@ -58,16 +43,10 @@ void func2(int &sink, int x) {
5843 // Destroy 'x' in the current frame.
5944 DESTROY_RSI;
6045
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
6348
6449 ++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
7150}
7251
7352__attribute__ ((noinline))
@@ -90,16 +69,10 @@ void func4_amb(int &sink, int x) {
9069 // Destroy 'x' in the current frame.
9170 DESTROY_RSI;
9271
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.
9574
9675 ++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.
10376}
10477
10578__attribute__ ((noinline))
@@ -125,16 +98,10 @@ void func7(int &sink, int x) {
12598 // Destroy 'x' in the current frame.
12699 DESTROY_RSI;
127100
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
130103
131104 ++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
138105}
139106
140107__attribute__ ((always_inline))
@@ -162,16 +129,10 @@ void func11_tailcalled(int &sink, int x) {
162129 // Destroy 'x' in the current frame.
163130 DESTROY_RSI;
164131
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
167134
168135 ++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
175136}
176137
177138__attribute__ ((noinline))
@@ -189,16 +150,10 @@ void func13(int &sink, int x) {
189150 // Destroy 'x' in the current frame.
190151 DESTROY_RSI;
191152
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
196155
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;
202157}
203158
204159__attribute__ ((noinline, disable_tail_calls))
0 commit comments