Files
swift-mirror/test/ModuleInterface/optimization-level.swift
Erik Eckstein c578c937c8 SILOptimizer: run the GlobalOpt pass in the mandatory pipeline.
Replace the dynamic initialization of trivial globals with statically initialized globals, even in -Onone.
This is required to be able to use global variables in performance-annotated functions.
Also, it's a small performance improvement for -Onone.
2021-10-29 22:35:57 +02:00

17 lines
855 B
Swift

// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -typecheck -emit-module-interface-path %t/Lib.swiftinterface %s -O
// RUN: %target-swift-frontend -compile-module-from-interface %t/Lib.swiftinterface -Xllvm -sil-print-pass-name -o /dev/null 2>&1 | %FileCheck --check-prefix OPT %s
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -typecheck -emit-module-interface-path %t/Lib.swiftinterface %s -Onone
// RUN: %target-swift-frontend -compile-module-from-interface %t/Lib.swiftinterface -Xllvm -sil-print-pass-name -o /dev/null 2>&1 | %FileCheck --check-prefix UNOPT %s
// This is a bit of an implementation detail, but we want to make sure
// optimization passes don't run when compiling a .swiftinterface that was
// generated with -Onone.
// OPT: AccessMarkerElimination
// UNOPT-NOT: AccessMarkerElimination
public func f() {}