Skip to content

Commit

Permalink
Run the native swift demangler tests on darwin-x64 too ##bin
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed Jul 10, 2024
1 parent 4a6b2cd commit f173845
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
2 changes: 1 addition & 1 deletion libr/bin/mangling/swift-sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// R2R db/tools/rabin2

// set this to true for debugging purposes
#define USE_THIS_CODE 1
#define USE_THIS_CODE 0

static R_TH_LOCAL int have_swift_demangle = -1;
#if R2__UNIX__
Expand Down
43 changes: 43 additions & 0 deletions test/db/archos/darwin-x86_64/swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
NAME=swift demangling trylib false
FILE=-
CMDS=<<EOF
%RABIN2_SWIFTLIB=0
!!rabin2 -D swift _TFC4test7MyClass9calculatefS0_FT1xSi_Si
EOF
EXPECT=<<EOF
Swift.test.MyClass.calculate (self) -> (): , ) ()
EOF
RUN

NAME=swift demangling trylib true
FILE=-
CMDS=<<EOF
%RABIN2_SWIFTLIB=1
!!rabin2 -D swift _TFC4test7MyClass9calculatefS0_FT1xSi_Si
EOF
EXPECT=<<EOF
test.MyClass.calculate(test.MyClass) -> (x: Swift.Int) -> Swift.Int
EOF
RUN

NAME=swift demangling config var internal
FILE=-
CMDS=<<EOF
-e bin.demangle.trylib=false
iD swift _TFC4test7MyClass9calculatefS0_FT1xSi_Si
EOF
EXPECT=<<EOF
Swift.test.MyClass.calculate (self) -> (): , ) ()
EOF
RUN

NAME=swift demangling config var system library
FILE=-
CMDS=<<EOF
-e bin.demangle.trylib=true
iD swift _TFC4test7MyClass9calculatefS0_FT1xSi_Si
EOF
EXPECT=<<EOF
test.MyClass.calculate(test.MyClass) -> (x: Swift.Int) -> Swift.Int
EOF
RUN

0 comments on commit f173845

Please sign in to comment.