Skip to content

Commit

Permalink
Update codegen expected disassembly for MSVC 19.29.30157.0
Browse files Browse the repository at this point in the history
  • Loading branch information
NUCLEAR-BOMB committed Nov 18, 2024
1 parent 76691fa commit 38e3785
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions test/codegen/sample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,20 @@ void option_float_assign(opt::option<float>* a) {
//$ mov byte ptr [rcx + 0x4], 0x1
//$ ret

//$ @optional_float_assign {msvc}:
//$ @optional_float_assign {msvc >19.29.30157.0}:
//$ mov dword ptr [rsp + 0x8], 0x3f800000
//$ mov byte ptr [rsp + 0xc], 0x1
//$ mov rax, qword ptr [rsp + 0x8]
//$ mov qword ptr [rcx], rax
//$ ret

//$ @optional_float_assign {msvc <=19.29.30157.0}:
//$ movss xmm0, dword ptr <void __cdecl optional_float_assign(class std::optional<float> *)+0x8>
//$ movss dword ptr [rsp + 0x8], xmm0
//$ mov byte ptr [rsp + 0xc], 0x1
//$ mov rax, qword ptr [rsp + 0x8]
//$ mov qword ptr [rcx], rax
//$ ret
void optional_float_assign(std::optional<float>* a) {
*a = 1.f;
}
Expand Down Expand Up @@ -218,11 +226,17 @@ enum class enum_uint16 : std::uint16_t { a = 2 };
//$ mov eax, 0x2
//$ ret

//$ @option_enum_uint16_return {msvc}:
//$ @option_enum_uint16_return {msvc >19.29.30157.0}:
//$ mov word ptr [rcx], 0x2
//$ mov rax, rcx
//$ ret

//$ @option_enum_uint16_return {msvc <=19.29.30157.0}:
//$ mov eax, 0x2
//$ mov word ptr [rcx], ax
//$ mov rax, rcx
//$ ret

//$ @option_enum_uint16_return {clang-cl}:
//$ mov rax, rcx
//$ mov word ptr [rcx], 0x2
Expand All @@ -242,12 +256,19 @@ opt::option<enum_uint16> option_enum_uint16_return() {
//$ mov eax, dword ptr [rsp - 0x4]
//$ ret

//$ @optional_enum_uint16_return {msvc}:
//$ @optional_enum_uint16_return {msvc >19.29.30157.0}:
//$ mov word ptr [rcx], 0x2
//$ mov rax, rcx
//$ mov byte ptr [rcx + 0x2], 0x1
//$ ret

//$ @optional_enum_uint16_return {msvc <=19.29.30157.0}:
//$ mov eax, 0x2
//$ mov byte ptr [rcx + 0x2], 0x1
//$ mov word ptr [rcx], ax
//$ mov rax, rcx
//$ ret

//$ @optional_enum_uint16_return {clang-cl}:
//$ mov rax, rcx
//$ mov word ptr [rcx], 0x2
Expand Down

0 comments on commit 38e3785

Please sign in to comment.