diff --git a/compiler/testData/klibABI/removeClassAsParameterType/main/m.kt b/compiler/testData/klibABI/removeClassAsParameterType/main/m.kt index 6344bc0c9ca..36d477bded6 100644 --- a/compiler/testData/klibABI/removeClassAsParameterType/main/m.kt +++ b/compiler/testData/klibABI/removeClassAsParameterType/main/m.kt @@ -2,8 +2,8 @@ fun test1(d: D): String { try { d.bar() - } catch(ex: Throwable) { - return "O" + } catch(e: Throwable) { + if (e.isLinkageError("/E.")) return "O" } return "FAIL2" @@ -16,4 +16,7 @@ fun test2(d: D): String { fun box(): String { return test1(D()) + test2(D()) -} \ No newline at end of file +} + +private fun Throwable.isLinkageError(symbolName: String): Boolean = + this::class.simpleName == "IrLinkageError" && message?.startsWith("Unlinked IR symbol $symbolName|") == true diff --git a/compiler/testData/klibABI/removeClassAsReturnType/main/m.kt b/compiler/testData/klibABI/removeClassAsReturnType/main/m.kt index 6344bc0c9ca..d6b501241bd 100644 --- a/compiler/testData/klibABI/removeClassAsReturnType/main/m.kt +++ b/compiler/testData/klibABI/removeClassAsReturnType/main/m.kt @@ -2,8 +2,8 @@ fun test1(d: D): String { try { d.bar() - } catch(ex: Throwable) { - return "O" + } catch(e: Throwable) { + if (e.isLinkageError("/D.exp")) return "O" } return "FAIL2" @@ -16,4 +16,7 @@ fun test2(d: D): String { fun box(): String { return test1(D()) + test2(D()) -} \ No newline at end of file +} + +private fun Throwable.isLinkageError(symbolName: String): Boolean = + this::class.simpleName == "IrLinkageError" && message?.startsWith("Unlinked type in signature of IR symbol $symbolName|") == true diff --git a/compiler/testData/klibABI/removeClassAsSuperTypeArgument/main/m.kt b/compiler/testData/klibABI/removeClassAsSuperTypeArgument/main/m.kt index 6344bc0c9ca..d6b501241bd 100644 --- a/compiler/testData/klibABI/removeClassAsSuperTypeArgument/main/m.kt +++ b/compiler/testData/klibABI/removeClassAsSuperTypeArgument/main/m.kt @@ -2,8 +2,8 @@ fun test1(d: D): String { try { d.bar() - } catch(ex: Throwable) { - return "O" + } catch(e: Throwable) { + if (e.isLinkageError("/D.exp")) return "O" } return "FAIL2" @@ -16,4 +16,7 @@ fun test2(d: D): String { fun box(): String { return test1(D()) + test2(D()) -} \ No newline at end of file +} + +private fun Throwable.isLinkageError(symbolName: String): Boolean = + this::class.simpleName == "IrLinkageError" && message?.startsWith("Unlinked type in signature of IR symbol $symbolName|") == true diff --git a/compiler/testData/klibABI/removeClassAsTypeArgument/main/m.kt b/compiler/testData/klibABI/removeClassAsTypeArgument/main/m.kt index 6344bc0c9ca..d6b501241bd 100644 --- a/compiler/testData/klibABI/removeClassAsTypeArgument/main/m.kt +++ b/compiler/testData/klibABI/removeClassAsTypeArgument/main/m.kt @@ -2,8 +2,8 @@ fun test1(d: D): String { try { d.bar() - } catch(ex: Throwable) { - return "O" + } catch(e: Throwable) { + if (e.isLinkageError("/D.exp")) return "O" } return "FAIL2" @@ -16,4 +16,7 @@ fun test2(d: D): String { fun box(): String { return test1(D()) + test2(D()) -} \ No newline at end of file +} + +private fun Throwable.isLinkageError(symbolName: String): Boolean = + this::class.simpleName == "IrLinkageError" && message?.startsWith("Unlinked type in signature of IR symbol $symbolName|") == true diff --git a/compiler/testData/klibABI/removeFunction/main/m.kt b/compiler/testData/klibABI/removeFunction/main/m.kt index 4d3d948dae3..6f8825bde03 100644 --- a/compiler/testData/klibABI/removeFunction/main/m.kt +++ b/compiler/testData/klibABI/removeFunction/main/m.kt @@ -1,9 +1,8 @@ - fun test1(): String { try { return qux(true) - } catch(ex: Throwable) { - return "O" + } catch(e: Throwable) { + if (e.isLinkageError("/exp_foo")) return "O" } return "FAIL2" @@ -13,4 +12,7 @@ fun test2(): String = qux(false) fun box(): String { return test1() + test2() -} \ No newline at end of file +} + +private fun Throwable.isLinkageError(symbolName: String): Boolean = + this::class.simpleName == "IrLinkageError" && message?.startsWith("Unlinked IR symbol $symbolName|") == true