Files
swift-mirror/test/Serialization/basic_sil_objc.swift
Erik Eckstein 7cceaff5f3 SIL: don't print operand types in textual SIL
Type annotations for instruction operands are omitted, e.g.

```
  %3 = struct $S(%1, %2)
```

Operand types are redundant anyway and were only used for sanity checking in the SIL parser.

But: operand types _are_ printed if the definition of the operand value was not printed yet.
This happens:

* if the block with the definition appears after the block where the operand's instruction is located

* if a block or instruction is printed in isolation, e.g. in a debugger

The old behavior can be restored with `-Xllvm -sil-print-types`.
This option is added to many existing test files which check for operand types in their check-lines.
2024-11-21 18:49:52 +01:00

20 lines
919 B
Swift

// RUN: %empty-directory(%t)
// RUN: %target-build-swift -Xllvm -sil-disable-pass=simplification -Xfrontend %clang-importer-sdk -I %S/../Inputs/clang-importer-sdk/swift-modules -emit-module -Xfrontend -disable-diagnostic-passes -whole-module-optimization -o %t/def_basic_objc.swiftmodule %S/Inputs/def_basic_objc.sil
// RUN: llvm-bcanalyzer %t/def_basic_objc.swiftmodule | %FileCheck %s
// RUN: %target-build-swift -Xfrontend %clang-importer-sdk -Xllvm -sil-print-types -emit-sil -I %t %s -o %t/basic_sil_objc.sil
// RUN: %target-sil-opt -sil-print-types -parse-serialized-sil %t/basic_sil_objc.sil -performance-linker -I %t | %FileCheck %S/Inputs/def_basic_objc.sil
// This test currently is written such that no optimizations are assumed.
// REQUIRES: swift_test_mode_optimize_none
// REQUIRES: objc_interop
// CHECK-NOT: UnknownCode
import def_basic_objc
import Foundation
func test_all() {
serialize_all()
}