Files
swift-mirror/test/IRGen/runtime_calling_conventions.swift
Anthony Latsis 55e5618eab [test] Match nocapture to succeed both on main and rebranch
Both the syntax and relative order of the LLVM `nocapture` parameter
attribute changed upstream in 29441e4f5fa5f5c7709f7cf180815ba97f611297.
To reduce conflicts with rebranch, adjust FileCheck patterns to expect
both syntaxes and orders anywhere the presence of the attribute is not
critical to the test. These changes are temporary and will be cleaned
up once rebranch is merged into main.
2025-05-08 23:52:43 +01:00

20 lines
931 B
Swift

// RUN: %target-swift-frontend -module-name runtime_calling_conventions -parse-as-library -emit-ir %s | %FileCheck %s
// RUN: %target-swift-frontend -module-name runtime_calling_conventions -parse-as-library -O -emit-ir %s | %FileCheck --check-prefix=OPT-CHECK %s
// Test that runtime functions are invoked using the new calling convention.
public class C {
}
// CHECK-LABEL: define {{(dllexport )?}}{{(protected )?}}swiftcc void @"$s27runtime_calling_conventions3fooyyAA1CCF"(ptr %0)
// Check that runtime functions use a proper calling convention.
// CHECK-NOT: call void {{.*}} @swift_release
// OPT-CHECK-LABEL: define {{(dllexport )?}}{{(protected )?}}swiftcc void @"$s{{(27|28)}}runtime_calling_conventions3fooyyAA1CCF"(ptr{{( nocapture)?}} readnone{{( captures\(none\))?}} %0)
// Check that runtime functions use a proper calling convention.
// OPT-CHECK-NOT: tail call void @swift_release
public func foo(_ c: C) {
}