From a3bfe58415347e44b5a46e1a095b3d64aa199d64 Mon Sep 17 00:00:00 2001 From: Dmitriy Dolovov Date: Thu, 2 Nov 2023 12:06:46 +0100 Subject: [PATCH] [KLIB tool] Fix failing test on dumping c-interop signatures --- .../klib/dump-signatures/just_cinterop_c.def | 15 ++++++--------- .../just_cinterop_c.metadata-signatures.v1.txt | 14 ++++++++------ .../just_cinterop_c.metadata-signatures.v2.txt | 12 +++++++----- 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/native/native.tests/testData/klib/dump-signatures/just_cinterop_c.def b/native/native.tests/testData/klib/dump-signatures/just_cinterop_c.def index 5f59205065a..7c6678b2663 100644 --- a/native/native.tests/testData/klib/dump-signatures/just_cinterop_c.def +++ b/native/native.tests/testData/klib/dump-signatures/just_cinterop_c.def @@ -3,10 +3,15 @@ language = C package = just_cinterop_c --- typedef struct my_struct { + signed char c; int i; - long l; + short s; } my_struct_t; +static signed char do_signed_char(signed char x) { + return x; +} + static short do_short(short x) { return x; } @@ -15,14 +20,6 @@ static int do_int(int x) { return x; } -static long do_long(long x) { - return x; -} - -static long long do_long_long(long long x) { - return x; -} - static void* do_void_ptr(void* x) { return x; } diff --git a/native/native.tests/testData/klib/dump-signatures/just_cinterop_c.metadata-signatures.v1.txt b/native/native.tests/testData/klib/dump-signatures/just_cinterop_c.metadata-signatures.v1.txt index cee5a6d80b0..d86910e1ea4 100644 --- a/native/native.tests/testData/klib/dump-signatures/just_cinterop_c.metadata-signatures.v1.txt +++ b/native/native.tests/testData/klib/dump-signatures/just_cinterop_c.metadata-signatures.v1.txt @@ -1,9 +1,8 @@ just_cinterop_c/do_int|1434322103267605694[100] -just_cinterop_c/do_long_long|5431512018338225197[100] -just_cinterop_c/do_long|3843623137338116199[100] just_cinterop_c/do_my_struct_t_ptr|-1042971359980028537[100] just_cinterop_c/do_my_struct_t|-3313067324655591103[100] just_cinterop_c/do_short|3714564778502624739[100] +just_cinterop_c/do_signed_char|-3061129409597428672[100] just_cinterop_c/do_void_ptr|6411325604211317372[100] just_cinterop_c/my_struct.|-4957092806283426321[100] just_cinterop_c/my_struct.Companion.|-5645683436151566731[100] @@ -15,17 +14,20 @@ just_cinterop_c/my_struct.Companion.size.|-8255337774232345969[100] just_cinterop_c/my_struct.Companion.size|-6253659984320132064[100] just_cinterop_c/my_struct.Companion.toString|-1522858123163872138[100] just_cinterop_c/my_struct.Companion|null[100] +just_cinterop_c/my_struct.c.|2368736057102379596[100] +just_cinterop_c/my_struct.c.|2630334304232045291[100] +just_cinterop_c/my_struct.c|-4416962153448040627[100] just_cinterop_c/my_struct.equals|4638265728071529943[100] just_cinterop_c/my_struct.hashCode|3409210261493131192[100] just_cinterop_c/my_struct.i.|6945482638966853621[100] just_cinterop_c/my_struct.i.|1223530399758590178[100] just_cinterop_c/my_struct.i|5014384761142332495[100] -just_cinterop_c/my_struct.l.|3795442967620585[100] -just_cinterop_c/my_struct.l.|-5446416953361928077[100] -just_cinterop_c/my_struct.l|3307215303229595169[100] just_cinterop_c/my_struct.rawPtr.|7179665485603104315[100] just_cinterop_c/my_struct.rawPtr.|-5421930354690237067[100] just_cinterop_c/my_struct.rawPtr|-9029326424296896258[100] +just_cinterop_c/my_struct.s.|-1662172381559511151[100] +just_cinterop_c/my_struct.s.|2278768972836500772[100] +just_cinterop_c/my_struct.s|7217541905509134881[100] just_cinterop_c/my_struct.toString|-1522858123163872138[100] just_cinterop_c/my_struct_t|null[100] -just_cinterop_c/my_struct|null[100] \ No newline at end of file +just_cinterop_c/my_struct|null[100] diff --git a/native/native.tests/testData/klib/dump-signatures/just_cinterop_c.metadata-signatures.v2.txt b/native/native.tests/testData/klib/dump-signatures/just_cinterop_c.metadata-signatures.v2.txt index 2383a18f314..2dbf8c8ceac 100644 --- a/native/native.tests/testData/klib/dump-signatures/just_cinterop_c.metadata-signatures.v2.txt +++ b/native/native.tests/testData/klib/dump-signatures/just_cinterop_c.metadata-signatures.v2.txt @@ -1,9 +1,8 @@ just_cinterop_c/do_int|do_int(kotlin.Int){}[100] -just_cinterop_c/do_long_long|do_long_long(kotlin.Long){}[100] -just_cinterop_c/do_long|do_long(kotlin.Long){}[100] just_cinterop_c/do_my_struct_t_ptr|do_my_struct_t_ptr(kotlinx.cinterop.CValuesRef?){}[100] just_cinterop_c/do_my_struct_t|do_my_struct_t(kotlinx.cinterop.CValue){}[100] just_cinterop_c/do_short|do_short(kotlin.Short){}[100] +just_cinterop_c/do_signed_char|do_signed_char(kotlin.Byte){}[100] just_cinterop_c/do_void_ptr|do_void_ptr(kotlinx.cinterop.CValuesRef<*>?){}[100] just_cinterop_c/my_struct.|(kotlin.native.internal.NativePtr){}[100] just_cinterop_c/my_struct.Companion.|(){}[100] @@ -15,17 +14,20 @@ just_cinterop_c/my_struct.Companion.size.|(){}[100] just_cinterop_c/my_struct.Companion.size|{}size[100] just_cinterop_c/my_struct.Companion.toString|toString(){}[100] just_cinterop_c/my_struct.Companion|null[100] +just_cinterop_c/my_struct.c.|(){}[100] +just_cinterop_c/my_struct.c.|(kotlin.Byte){}[100] +just_cinterop_c/my_struct.c|{}c[100] just_cinterop_c/my_struct.equals|equals(kotlin.Any?){}[100] just_cinterop_c/my_struct.hashCode|hashCode(){}[100] just_cinterop_c/my_struct.i.|(){}[100] just_cinterop_c/my_struct.i.|(kotlin.Int){}[100] just_cinterop_c/my_struct.i|{}i[100] -just_cinterop_c/my_struct.l.|(){}[100] -just_cinterop_c/my_struct.l.|(kotlin.Long){}[100] -just_cinterop_c/my_struct.l|{}l[100] just_cinterop_c/my_struct.rawPtr.|(){}[100] just_cinterop_c/my_struct.rawPtr.|(kotlin.native.internal.NativePtr){}[100] just_cinterop_c/my_struct.rawPtr|{}rawPtr[100] +just_cinterop_c/my_struct.s.|(){}[100] +just_cinterop_c/my_struct.s.|(kotlin.Short){}[100] +just_cinterop_c/my_struct.s|{}s[100] just_cinterop_c/my_struct.toString|toString(){}[100] just_cinterop_c/my_struct_t|null[100] just_cinterop_c/my_struct|null[100]