File: skip_function_bodies_clang_enum_init_raw_value.swift

package info (click to toggle)
swiftlang 6.1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,791,532 kB
  • sloc: cpp: 9,901,743; ansic: 2,201,431; asm: 1,091,827; python: 308,252; objc: 82,166; f90: 80,126; lisp: 38,358; pascal: 25,559; sh: 20,429; ml: 5,058; perl: 4,745; makefile: 4,484; awk: 3,535; javascript: 3,018; xml: 918; fortran: 664; cs: 573; ruby: 396
file content (21 lines) | stat: -rw-r--r-- 1,393 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -emit-silgen %s -module-name main -import-objc-header %S/Inputs/open_enum.h -experimental-skip-non-inlinable-function-bodies | %FileCheck %s
// RUN: %target-swift-frontend -emit-silgen %s -module-name main -import-objc-header %S/Inputs/open_enum.h -experimental-skip-non-inlinable-function-bodies-without-types | %FileCheck %s
// RUN: %target-swift-frontend -emit-silgen %s -module-name main -import-objc-header %S/Inputs/open_enum.h -debug-forbid-typecheck-prefix SKIP_ALL_NO_TYPECHECK -experimental-skip-all-function-bodies | %FileCheck %s --check-prefix=CHECK-SKIP-ALL

// CHECK-SKIP-ALL-NOT: s4main13inlinableFuncSo7YesOrNoVyF

// CHECK: sil [serialized]{{.*}} @$s4main13inlinableFuncSo7YesOrNoVyF : $@convention(thin) () -> YesOrNo {
// CHECK:   return {{%.*}} : $YesOrNo
// CHECK: } // end sil function '$s4main13inlinableFuncSo7YesOrNoVyF'
@inlinable public func inlinableFunc() -> YesOrNo {
  let SKIP_ALL_NO_TYPECHECK = 1
  _ = SKIP_ALL_NO_TYPECHECK
  return YesOrNo(rawValue: 1)!
}

// CHECK-SKIP-ALL-NOT: sSo7YesOrNoV8rawValueABSgs5Int32V_tcfC

// CHECK: sil shared [serialized]{{.*}} @$sSo7YesOrNoV8rawValueABSgs5Int32V_tcfC : $@convention(method) (Int32, @thin YesOrNo.Type) -> Optional<YesOrNo> {
// CHECK:   return {{%.*}} : $Optional<YesOrNo>
// CHECK: } // end sil function '$sSo7YesOrNoV8rawValueABSgs5Int32V_tcfC'