mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-19 19:10:17 +00:00
enable LTO
This commit is contained in:
parent
df4e0e329a
commit
7c3ac48202
@ -79,4 +79,12 @@ endif()
|
||||
|
||||
if(PK_EXPORT_CXX_SYMBOLS AND MSVC)
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# enable link time optimization
|
||||
include(CheckIPOSupported)
|
||||
check_ipo_supported(RESULT result)
|
||||
if(result)
|
||||
message(STATUS "LTO enabled")
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE)
|
||||
endif()
|
||||
|
@ -283,7 +283,7 @@ static bool is_unicode_Lo_char(uint32_t c) {
|
||||
|
||||
int base = 10;
|
||||
if (m[1].matched) {
|
||||
char tag = m[1].first.base()[1];
|
||||
char tag = m[1].first[1];
|
||||
switch (tag) {
|
||||
case 'x': base = 16; break;
|
||||
case 'o': base = 8; break;
|
||||
@ -303,7 +303,7 @@ static bool is_unicode_Lo_char(uint32_t c) {
|
||||
}
|
||||
add_token(TK("@num"), out);
|
||||
} else {
|
||||
std::string_view text(m[0].first.base(), m[0].length());
|
||||
std::string_view text(&m[0].first[0], m[0].length());
|
||||
i64 out;
|
||||
bool ok = parse_int(text, &out, base);
|
||||
if(!ok){
|
||||
|
@ -2,16 +2,23 @@
|
||||
assert 0xffff == 65535
|
||||
assert 0xAAFFFF == 11206655
|
||||
assert 0x7fffffff == 2147483647
|
||||
assert -0xffff == -65535
|
||||
assert -0xAAFFFF == -11206655
|
||||
assert -0x7fffffff == -2147483647
|
||||
# test 64-bit
|
||||
assert 2**60-1 + 546 - 0xfffffffffffff == 1148417904979477026
|
||||
|
||||
# test oct literals
|
||||
assert 0o1234 == 668
|
||||
assert 0o17777777777 == 2147483647
|
||||
assert -0o1234 == -668
|
||||
assert -0o17777777777 == -2147483647
|
||||
|
||||
# test binary literals
|
||||
assert 0b10010 == 18
|
||||
assert -0b10010 == -18
|
||||
assert 0b11111111111111111111111111111111 == 4294967295
|
||||
assert -0b11111 == -31
|
||||
|
||||
# test == != >= <= < >
|
||||
assert -1 == -1
|
||||
|
Loading…
x
Reference in New Issue
Block a user