@@ -16,6 +16,14 @@ void does_not_throw() noexcept(true);
16
16
17
17
extern " C" void __declspec (dllimport) some_dll_import();
18
18
19
+ class __declspec (dllimport) FromDll {
20
+ int x;
21
+
22
+ public:
23
+ FromDll (int x);
24
+ ~FromDll ();
25
+ };
26
+
19
27
class HasDtor {
20
28
int x;
21
29
char foo[40 ];
@@ -33,13 +41,19 @@ class BadError {
33
41
// Verify that when NOP padding for IP2State is active *and* Import Call
34
42
// Optimization is active that we see both forms of NOP padding.
35
43
void case_calls_dll_import () NO_TAIL {
36
- some_dll_import ();
44
+ FromDll fromDll (10 );
45
+ might_throw ();
37
46
}
38
47
// CHECK-LABEL: .def "?case_calls_dll_import@@YAXXZ"
39
48
// CHECK: .seh_endprologue
40
49
// CHECK: .Limpcall{{[0-9]+}}:
41
- // CHECK-NEXT: rex64
42
- // CHECK-NEXT: call __imp_some_dll_import
50
+ // CHECK: rex64
51
+ // CHECK-NEXT: call "__imp_??0FromDll@@QEAA@H@Z"
52
+ // CHECK-NEXT: nop dword ptr {{\[.*\]}}
53
+ // CHECK-NEXT: nop
54
+ // CHECK: call "?might_throw@@YAXXZ"
55
+ // CHECK: rex64
56
+ // CHECK-NEXT: call "__imp_??1FromDll@@QEAA@XZ"
43
57
// CHECK-NEXT: nop dword ptr {{\[.*\]}}
44
58
// CHECK-NEXT: nop
45
59
// CHECK-NEXT: .seh_startepilogue
@@ -118,7 +132,6 @@ void case_except_simple_call() NO_TAIL
118
132
// CHECK-LABEL: .def "?case_except_simple_call@@YAXXZ"
119
133
// CHECK: .seh_endprologue
120
134
// CHECK-NEXT: call "?might_throw@@YAXXZ"
121
- // CHECK-NEXT: nop
122
135
// CHECK-NEXT: .seh_startepilogue
123
136
124
137
// Simple call of a function that cannot throw, in a noexcept context.
@@ -129,7 +142,6 @@ void case_noexcept_simple_call() noexcept(true) NO_TAIL
129
142
// CHECK-LABEL: .def "?case_noexcept_simple_call@@YAXXZ"
130
143
// CHECK: .seh_endprologue
131
144
// CHECK-NEXT: call "?does_not_throw@@YAXXZ"
132
- // CHECK-NEXT: nop
133
145
// CHECK-NEXT: .seh_startepilogue
134
146
135
147
@@ -182,30 +194,6 @@ void case_dtor_runs_after_join(int x) {
182
194
}
183
195
184
196
185
- // Check the behavior of NOP padding around tail calls.
186
- // We do not expect to insert NOPs around tail calls.
187
- // However, the first call (to other_func()) does get a NOP
188
- // because it comes before .seh_startepilogue.
189
- void case_tail_call_no_eh () {
190
- // CHECK-LABEL: .def "?case_tail_call_no_eh@@YAXXZ"
191
- // CHECK: .seh_endprologue
192
-
193
- // ordinary call
194
- other_func (10 );
195
- // CHECK: call "?other_func@@YAXH@Z"
196
- // CHECK-NEXT: nop
197
-
198
- // tail call; no NOP padding after JMP
199
- does_not_throw ();
200
-
201
- // CHECK: .seh_startepilogue
202
- // CHECK: .seh_endepilogue
203
- // CHECK: jmp "?does_not_throw@@YAXXZ"
204
- // CHECK-NOT: nop
205
- // CHECK: .seh_endproc
206
- }
207
-
208
-
209
197
// Check the behavior of a try/catch
210
198
int case_try_catch () {
211
199
// CHECK-LABEL: .def "?case_try_catch@@YAHXZ"
0 commit comments