Skip to content

Commit 2cbe1c0

Browse files
committed
update clang tests
1 parent a7e33eb commit 2cbe1c0

File tree

2 files changed

+17
-31
lines changed

2 files changed

+17
-31
lines changed

clang/test/CodeGenCXX/microsoft-abi-eh-async.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ void case_except_simple_call() NO_TAIL
105105
// CHECK-LABEL: .def "?case_except_simple_call@@YAXXZ"
106106
// CHECK: .seh_endprologue
107107
// CHECK-NEXT: call "?does_not_throw@@YAXXZ"
108-
// CHECK-NEXT: nop
109108
// CHECK-NEXT: .seh_startepilogue
110109
// CHECK: .seh_endproc
111110

@@ -116,7 +115,6 @@ void case_noexcept_simple_call() noexcept(true) NO_TAIL
116115
// CHECK-LABEL: .def "?case_noexcept_simple_call@@YAXXZ"
117116
// CHECK: .seh_endprologue
118117
// CHECK-NEXT: call "?does_not_throw@@YAXXZ"
119-
// CHECK-NEXT: nop
120118
// CHECK-NEXT: .seh_startepilogue
121119
// CHECK: .seh_endepilogue
122120
// CHECK-NEXT: ret

clang/test/CodeGenCXX/microsoft-abi-eh-ip2state.cpp

Lines changed: 17 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ void does_not_throw() noexcept(true);
1616

1717
extern "C" void __declspec(dllimport) some_dll_import();
1818

19+
class __declspec(dllimport) FromDll {
20+
int x;
21+
22+
public:
23+
FromDll(int x);
24+
~FromDll();
25+
};
26+
1927
class HasDtor {
2028
int x;
2129
char foo[40];
@@ -33,13 +41,19 @@ class BadError {
3341
// Verify that when NOP padding for IP2State is active *and* Import Call
3442
// Optimization is active that we see both forms of NOP padding.
3543
void case_calls_dll_import() NO_TAIL {
36-
some_dll_import();
44+
FromDll fromDll(10);
45+
might_throw();
3746
}
3847
// CHECK-LABEL: .def "?case_calls_dll_import@@YAXXZ"
3948
// CHECK: .seh_endprologue
4049
// 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"
4357
// CHECK-NEXT: nop dword ptr {{\[.*\]}}
4458
// CHECK-NEXT: nop
4559
// CHECK-NEXT: .seh_startepilogue
@@ -118,7 +132,6 @@ void case_except_simple_call() NO_TAIL
118132
// CHECK-LABEL: .def "?case_except_simple_call@@YAXXZ"
119133
// CHECK: .seh_endprologue
120134
// CHECK-NEXT: call "?might_throw@@YAXXZ"
121-
// CHECK-NEXT: nop
122135
// CHECK-NEXT: .seh_startepilogue
123136

124137
// 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
129142
// CHECK-LABEL: .def "?case_noexcept_simple_call@@YAXXZ"
130143
// CHECK: .seh_endprologue
131144
// CHECK-NEXT: call "?does_not_throw@@YAXXZ"
132-
// CHECK-NEXT: nop
133145
// CHECK-NEXT: .seh_startepilogue
134146

135147

@@ -182,30 +194,6 @@ void case_dtor_runs_after_join(int x) {
182194
}
183195

184196

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-
209197
// Check the behavior of a try/catch
210198
int case_try_catch() {
211199
// CHECK-LABEL: .def "?case_try_catch@@YAHXZ"

0 commit comments

Comments
 (0)