File: global_resilience.swift

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (60 lines) | stat: -rw-r--r-- 2,578 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60

// RUN: %empty-directory(%t)
//
// Compile the external swift module.
// RUN: %target-swift-frontend -g -emit-module -enable-library-evolution \
// RUN:   -emit-module-path=%t/resilient_struct.swiftmodule \
// RUN:   -module-name=resilient_struct %S/../Inputs/resilient_struct.swift
//
// RUN: %target-swift-frontend -g -I %t -emit-ir -enable-library-evolution \
// RUN:   %s -o - | %FileCheck %s
import resilient_struct

// Fits in buffer
let small = Size(w: 1, h: 2)

// Needs out-of-line allocation
let large = Rectangle(p: Point(x: 1, y: 2), s: Size(w: 3, h: 4), color: 5)

let tuple = (Size(w: 1, h: 2), Size(w: 3, h: 4))

// CHECK: @"$s17global_resilience5small16resilient_struct4SizeVvp" =
// CHECK-SAME: !dbg ![[SMALL:[0-9]+]]
// CHECK: @"$s17global_resilience5large16resilient_struct9RectangleVvp" =
// CHECK-SAME: !dbg ![[LARGE:[0-9]+]]

// CHECK: @"$s17global_resilience5tuple
// CHECK-SAME: !dbg ![[TUPLE:[0-9]+]]

// CHECK: ![[SMALL]] = !DIGlobalVariableExpression(
// CHECK-SAME:            var: ![[VAR_SMALL:[0-9]+]]
// CHECK-SAME:            expr: !DIExpression())
// CHECK: ![[VAR_SMALL]] = distinct !DIGlobalVariable(
// CHECK-SAME:            type: ![[SMALL_TY:[0-9]+]]
// CHECK: ![[SMALL_TY]] = !DICompositeType(tag: DW_TAG_structure_type,
// CHECK-SAME:            name: "$swift.fixedbuffer",
// CHECK-SAME:            elements: ![[SMALL_TY_EL:[0-9]+]]
// CHECK: ![[SMALL_TY_EL]] = !{![[SMALL_TY_M:[0-9]+]]}
// CHECK: ![[SMALL_TY_M]] = !DIDerivedType(tag: DW_TAG_member,
// CHECK-SAME:            baseType: ![[SMALL_TY_CT:[0-9]+]]
// CHECK: ![[SMALL_TY_CT]] = !DIDerivedType(tag: DW_TAG_const_type,
// CHECK-SAME:            baseType: ![[SMALL_TY_TY:[0-9]+]]
// CHECK: ![[SMALL_TY_TY]] = !DICompositeType(
// CHECK-NOT:             size:
// CHECK-SAME:            DIFlagFwdDecl

// CHECK: ![[LARGE]] = !DIGlobalVariableExpression(
// CHECK-SAME:            var: ![[VAR_LARGE:[0-9]+]]
// CHECK-SAME:            expr: !DIExpression())
// CHECK: ![[VAR_LARGE]] = distinct !DIGlobalVariable(
// CHECK-SAME:            type: ![[LARGE_TY:[0-9]+]]
// CHECK: ![[LARGE_TY]] = !DICompositeType(tag: DW_TAG_structure_type,
// CHECK-SAME:            name: "$swift.fixedbuffer", 

// CHECK: ![[TUPLE]] = !DIGlobalVariableExpression(
// CHECK-SAME:            var: ![[VAR_TUPLE:[0-9]+]]
// CHECK-SAME:            expr: !DIExpression())
// CHECK: ![[VAR_TUPLE]] = distinct !DIGlobalVariable(
// CHECK-SAME:            type: ![[TUPLE_TY:[0-9]+]]
// CHECK: ![[TUPLE_TY]] = !DICompositeType(tag: DW_TAG_structure_type,
// CHECK-SAME:            name: "$swift.fixedbuffer",