From 52c8b6166c7063deaaeaf1d483496ec3c5e63a7a Mon Sep 17 00:00:00 2001 From: Sergey Bogolepov Date: Fri, 11 Feb 2022 13:19:40 +0300 Subject: [PATCH] [K/N] Fix filecheck_function_attributes_at_callsite test --- kotlin-native/backend.native/tests/build.gradle | 2 ++ .../tests/filecheck/function_attributes_at_callsite.kt | 8 ++++---- .../src/main/kotlin/org/jetbrains/kotlin/FileCheckTest.kt | 8 +++++++- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/kotlin-native/backend.native/tests/build.gradle b/kotlin-native/backend.native/tests/build.gradle index 7c248a6cc42..196eebe7541 100644 --- a/kotlin-native/backend.native/tests/build.gradle +++ b/kotlin-native/backend.native/tests/build.gradle @@ -6041,6 +6041,8 @@ fileCheckTest("filecheck_signext_zeroext_objc_export") { fileCheckTest("filecheck_function_attributes_at_callsite") { enabled = (project.testTarget != 'wasm32') // KT-49739 + // attributes for caller and callee might be the same so we allow overlapping. + additionalFileCheckFlags = ["--allow-deprecated-dag-overlap"] annotatedSource = project.file('filecheck/function_attributes_at_callsite.kt') } diff --git a/kotlin-native/backend.native/tests/filecheck/function_attributes_at_callsite.kt b/kotlin-native/backend.native/tests/filecheck/function_attributes_at_callsite.kt index 68cca8c96f9..3596041d663 100644 --- a/kotlin-native/backend.native/tests/filecheck/function_attributes_at_callsite.kt +++ b/kotlin-native/backend.native/tests/filecheck/function_attributes_at_callsite.kt @@ -17,7 +17,7 @@ fun main() { flameThrower() } -// CHECK-DAG: attributes #[[THROW_EXCEPTION_DECLARATION_ATTRIBUTES]] = { noreturn uwtable {{.+}} } -// CHECK-DAG: attributes #[[THROW_EXCEPTION_CALLSITE_ATTRIBUTES]] = { noreturn uwtable } -// CHECK-DAG: attributes #[[FLAME_THROWER_DECLARATION_ATTRIBUTES]] = { noreturn {{.+}} } -// CHECK-DAG: attributes #[[FLAME_THROWER_CALLSITE_ATTRIBUTES]] = { noreturn } \ No newline at end of file +// CHECK-DAG: attributes #[[THROW_EXCEPTION_DECLARATION_ATTRIBUTES]] = {{{.*}}noreturn{{.*}}} +// CHECK-DAG: attributes #[[THROW_EXCEPTION_CALLSITE_ATTRIBUTES]] = {{{.*}}noreturn{{.*}}} +// CHECK-DAG: attributes #[[FLAME_THROWER_DECLARATION_ATTRIBUTES]] = {{{.*}}noreturn{{.*}}} +// CHECK-DAG: attributes #[[FLAME_THROWER_CALLSITE_ATTRIBUTES]] = {{{.*}}noreturn{{.*}}} \ No newline at end of file diff --git a/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/FileCheckTest.kt b/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/FileCheckTest.kt index 576eee86a5a..c93969850a6 100644 --- a/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/FileCheckTest.kt +++ b/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/FileCheckTest.kt @@ -89,10 +89,16 @@ open class FileCheckTest : DefaultTask() { * Check that [inputFile] matches [annotatedFile] with FileCheck. */ private fun runFileCheck(annotatedFile: Path, inputFile: Path): ProcessOutput { - val args = mutableListOf(annotatedFile.toAbsolutePath().toString(), "--input-file", inputFile.toAbsolutePath().toString()) + val args = mutableListOf( + annotatedFile.toAbsolutePath().toString(), + "--input-file", inputFile.toAbsolutePath().toString() + ) checkPrefix?.let { args.addAll(listOf("--check-prefix", it)) } + additionalFileCheckFlags?.let { + args.addAll(it) + } val platform = project.platformManager.platform(target) val configurables = platform.configurables val llvmBin = "${configurables.absoluteLlvmHome}/bin"