mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
AK: Implement demangle() for MSVC ABI
This implements demangle() using Windows API. Also some rudimentary test is provided.
This commit is contained in:
parent
1861f24979
commit
e03c558a0a
Notes:
github-actions[bot]
2025-06-18 00:40:29 +00:00
Author: https://github.com/tomaszstrejczek 🔰
Commit: e03c558a0a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5000
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/R-Goc
6 changed files with 107 additions and 6 deletions
22
Tests/AK/TestDemangle.cpp
Normal file
22
Tests/AK/TestDemangle.cpp
Normal file
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* Copyright (c) 2025, Tomasz Strejczek
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibTest/TestCase.h>
|
||||
|
||||
#include <AK/Demangle.h>
|
||||
|
||||
TEST_CASE(class_method)
|
||||
{
|
||||
#ifndef AK_OS_WINDOWS
|
||||
auto test_string = "_ZNK2AK9Utf16View22unicode_substring_viewEmm"sv;
|
||||
auto expected_result = "AK::Utf16View::unicode_substring_view(unsigned long, unsigned long) const"sv;
|
||||
#else
|
||||
auto test_string = "?unicode_substring_view@Utf16View@AK@@QEBA?AV12@_K0@Z"sv;
|
||||
auto expected_result = "public: class AK::Utf16View __cdecl AK::Utf16View::unicode_substring_view(unsigned __int64,unsigned __int64)const __ptr64"sv;
|
||||
#endif
|
||||
|
||||
EXPECT_EQ(expected_result, demangle(test_string));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue