|
1 | 1 | // RUN: rm -rf %t && mkdir -p %t
|
2 | 2 | // RUN: %target-build-swift -Xfrontend -enable-reflection-metadata -Xfrontend -enable-reflection-names -lswiftSwiftReflectionTest %s -o %T/example
|
3 |
| -// RUN: %target-swift-reflection-test %T/example 2>&1 | FileCheck %s |
| 3 | +// RUN: %target-run %target-swift-reflection-test %T/example 2>&1 | FileCheck %s --check-prefix=CHECK-%target-ptrsize |
4 | 4 | // REQUIRES: objc_interop
|
5 | 5 |
|
6 | 6 | import SwiftReflectionTest
|
@@ -44,38 +44,71 @@ var mc = MyClass(x: lhs, y: rhs, f: doFoo)
|
44 | 44 |
|
45 | 45 | reflect(object: mc)
|
46 | 46 |
|
47 |
| -// CHECK: Reflecting an object. |
48 |
| -// CHECK: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} |
49 |
| - |
50 |
| -// CHECK: Type reference: |
51 |
| -// CHECK: (bound_generic_class example.MyClass |
52 |
| -// CHECK: (class example.Container) |
53 |
| -// CHECK: (class example.Container)) |
54 |
| - |
55 |
| -// CHECK: Type info: |
56 |
| -// CHECK: (class_instance size=48 alignment=16 stride=48 num_extra_inhabitants=0 |
57 |
| -// CHECK: (field name=f offset=16 |
58 |
| -// CHECK: (thick_function size=16 alignment=8 stride=16 num_extra_inhabitants=0 |
59 |
| -// CHECK: (field name=function offset=0 |
60 |
| -// CHECK: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=1)) |
61 |
| -// CHECK: (field name=context offset=8 |
62 |
| -// CHECK: (reference kind=strong refcounting=native)))) |
63 |
| -// CHECK: (field name=x offset=32 |
64 |
| -// CHECK: (reference kind=strong refcounting=native)) |
65 |
| -// CHECK: (field name=y offset=40 |
66 |
| -// CHECK: (reference kind=strong refcounting=native))) |
| 47 | +// CHECK-64: Reflecting an object. |
| 48 | +// CHECK-64: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} |
| 49 | + |
| 50 | +// CHECK-64: Type reference: |
| 51 | +// CHECK-64: (bound_generic_class example.MyClass |
| 52 | +// CHECK-64: (class example.Container) |
| 53 | +// CHECK-64: (class example.Container)) |
| 54 | + |
| 55 | +// CHECK-64: Type info: |
| 56 | +// CHECK-64: (class_instance size=48 alignment=16 stride=48 num_extra_inhabitants=0 |
| 57 | +// CHECK-64: (field name=f offset=16 |
| 58 | +// CHECK-64: (thick_function size=16 alignment=8 stride=16 num_extra_inhabitants=0 |
| 59 | +// CHECK-64: (field name=function offset=0 |
| 60 | +// CHECK-64: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=1)) |
| 61 | +// CHECK-64: (field name=context offset=8 |
| 62 | +// CHECK-64: (reference kind=strong refcounting=native)))) |
| 63 | +// CHECK-64: (field name=x offset=32 |
| 64 | +// CHECK-64: (reference kind=strong refcounting=native)) |
| 65 | +// CHECK-64: (field name=y offset=40 |
| 66 | +// CHECK-64: (reference kind=strong refcounting=native))) |
| 67 | + |
| 68 | + |
| 69 | +// CHECK-32: Reflecting an object. |
| 70 | +// CHECK-32: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} |
| 71 | + |
| 72 | +// CHECK-32: Type reference: |
| 73 | +// CHECK-32: (bound_generic_class example.MyClass |
| 74 | +// CHECK-32: (class example.Container) |
| 75 | +// CHECK-32: (class example.Container)) |
| 76 | + |
| 77 | +// CHECK-32: Type info: |
| 78 | +// CHECK-32: (class_instance size=28 alignment=16 stride=32 num_extra_inhabitants=0 |
| 79 | +// CHECK-32: (field name=f offset=12 |
| 80 | +// CHECK-32: (thick_function size=8 alignment=4 stride=8 num_extra_inhabitants=0 |
| 81 | +// CHECK-32: (field name=function offset=0 |
| 82 | +// CHECK-32: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=1)) |
| 83 | +// CHECK-32: (field name=context offset=4 |
| 84 | +// CHECK-32: (reference kind=strong refcounting=native)))) |
| 85 | +// CHECK-32: (field name=x offset=20 |
| 86 | +// CHECK-32: (reference kind=strong refcounting=native)) |
| 87 | +// CHECK-32: (field name=y offset=24 |
| 88 | +// CHECK-32: (reference kind=strong refcounting=native))) |
67 | 89 |
|
68 | 90 | reflect(any: mc)
|
69 | 91 |
|
70 |
| -// CHECK: Reflecting an existential. |
71 |
| -// CHECK: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} |
72 |
| -// CHECK: Type reference: |
73 |
| -// CHECK: (bound_generic_class example.MyClass |
74 |
| -// CHECK: (class example.Container) |
75 |
| -// CHECK: (class example.Container)) |
| 92 | +// CHECK-64: Reflecting an existential. |
| 93 | +// CHECK-64: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} |
| 94 | +// CHECK-64: Type reference: |
| 95 | +// CHECK-64: (bound_generic_class example.MyClass |
| 96 | +// CHECK-64: (class example.Container) |
| 97 | +// CHECK-64: (class example.Container)) |
| 98 | + |
| 99 | +// CHECK-64: Type info: |
| 100 | +// CHECK-64: (reference kind=strong refcounting=native) |
| 101 | + |
| 102 | + |
| 103 | +// CHECK-32: Reflecting an existential. |
| 104 | +// CHECK-32: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} |
| 105 | +// CHECK-32: Type reference: |
| 106 | +// CHECK-32: (bound_generic_class example.MyClass |
| 107 | +// CHECK-32: (class example.Container) |
| 108 | +// CHECK-32: (class example.Container)) |
76 | 109 |
|
77 |
| -// CHECK: Type info: |
78 |
| -// CHECK: (reference kind=strong refcounting=native) |
| 110 | +// CHECK-32: Type info: |
| 111 | +// CHECK-32: (reference kind=strong refcounting=native) |
79 | 112 |
|
80 | 113 | doneReflecting()
|
81 | 114 |
|
0 commit comments