mirror of
https://github.com/apple/swift.git
synced 2026-10-18 17:49:23 +02:00
This enables us to: - Require at least a given `LLVM_VERSION_MAJOR`, 23 or greater, for a test, or apply the same logic to other Lit directives (`UNSUPPORTED` and `XFAIL`): ``` // REQUIRES: LLVM_VERSION_MAJOR_AT_LEAST_24 ``` - Form FileCheck prefixes based on `LLVM_VERSION_MAJOR` to implement version-sensitive checks: ``` // RUN: %target-swift-frontend -emit-ir %s | %FileCheck %s --check-prefixes CHECK,CHECK-LLVM-%llvm_version_major` // CHECK-LABEL: define swiftcc void @foo // CHECK-LLVM-23: getelementptr inbounds ([3 x i32], ptr @"$s1A7AStructVAA8FuncOnlyAAWP", i32 0, i32 1) // CHECK-LLVM-24: getelementptr inbounds (i8, ptr @"$s1A7AStructVAA8FuncOnlyAAWP", i64 4) ``` These mechanisms are meant to provide redundancy for adapting to upstream `llvm-project` changes on the `main` branch. Follow-up to https://github.com/swiftlang/swift/pull/92138.