mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Specifically, I renamed the old llvm-as which printed with optimization as llvm-as-opt and made llvm-as just test IRGen. That is really the true reason that I created this utility many years ago: to test how IRGen lowers specific SIL instruction sequences. How LLVM optimizes such sequences once lowered is a different problem. I updated the one test that used sil-llvm-gen and required optimizations to use llvm-as-opt so that the tests output did not change.
28 lines
1.6 KiB
Plaintext
28 lines
1.6 KiB
Plaintext
// RUN: %sil-llvm-gen -disable-legacy-type-info -output-kind=llvm-as-opt -target x86_64-apple-macosx10.9 -module-name main %s -o - | %FileCheck %s
|
|
// RUN: %sil-llvm-gen -disable-legacy-type-info -output-kind=llvm-as-opt -target i386-apple-ios7.0 %s -module-name main -o - | %FileCheck %s
|
|
// RUN: %sil-llvm-gen -disable-legacy-type-info -output-kind=llvm-as-opt -target x86_64-apple-ios7.0 %s -module-name main -o - | %FileCheck %s
|
|
// RUN: %sil-llvm-gen -disable-legacy-type-info -output-kind=llvm-as-opt -target armv7-apple-ios7.0 %s -module-name main -o - | %FileCheck %s
|
|
// RUN: %sil-llvm-gen -disable-legacy-type-info -output-kind=llvm-as-opt -target arm64-apple-ios7.0 %s -module-name main -o - | %FileCheck %s
|
|
// RUN: %sil-llvm-gen -disable-legacy-type-info -output-kind=llvm-as-opt -target x86_64-unknown-linux-gnu %s -module-name main -o - | %FileCheck %s
|
|
|
|
// Use this testfile to check if the `swift-frontend -sil-llvm-gen` option works.
|
|
// RUN: %swift_frontend_plain -sil-llvm-gen -disable-legacy-type-info -output-kind=llvm-as-opt -target x86_64-apple-macosx10.9 -module-name main %s -o - | %FileCheck %s
|
|
|
|
// REQUIRES: CODEGENERATOR=X86
|
|
// REQUIRES: CODEGENERATOR=ARM
|
|
|
|
import Builtin
|
|
|
|
struct Pair<T> {
|
|
var fst: T, snd: T
|
|
}
|
|
|
|
struct Huge {
|
|
var pairs: Pair<Pair<Pair<Pair<Pair<Pair<Pair<Pair<Pair<Builtin.Int64>>>>>>>>>
|
|
var unalign: Builtin.Int8
|
|
}
|
|
|
|
// CHECK: define linkonce_odr hidden ptr @__swift_memcpy4097_8(ptr %0, ptr %1, ptr %2)
|
|
// CHECK: call void @llvm.memcpy.p0.p0.{{(i64|i32)}}(ptr align 8 %0, ptr align 8 %1, {{(i64|i32)}} 4097, i1 false)
|
|
// CHECK: ret ptr %0
|