Skip to content

Commit 58e4340

Browse files
committed
Build fix: Section names on Linux have different prefix
This test was mostly to make sure -strip-reflection-metadata and -strip-reflection-names does what it says, so I'm temporarily removing the check for the full constant reflection struct.
1 parent 19869d4 commit 58e4340

File tree

1 file changed

+20
-82
lines changed

1 file changed

+20
-82
lines changed

test/IRGen/reflection_metadata.swift

Lines changed: 20 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -2,90 +2,28 @@
22
// RUN: %target-swift-frontend -enable-reflection-metadata -strip-reflection-names -emit-ir %S/Inputs/reflection_metadata.swift | FileCheck %s --check-prefix=STRIP_REFLECTION_NAMES
33
// RUN: %target-swift-frontend -enable-reflection-metadata -strip-reflection-metadata -emit-ir %S/Inputs/reflection_metadata.swift | FileCheck %s --check-prefix=STRIP_REFLECTION_METADATA
44

5-
// STRIP_REFLECTION_NAMES-NOT: {{.*}}__swift3_reflstr
6-
// STRIP_REFLECTION_NAMES_DAG: {{.*}}__swift3_reflect
5+
// STRIP_REFLECTION_NAMES-NOT: {{.*}}swift3_reflstr
6+
// STRIP_REFLECTION_NAMES_DAG: {{.*}}swift3_reflect
77
// STRIP_REFLECTION_NAMES-DAG: @"\01l__swift3_reflection_metadata"
88

9-
// STRIP_REFLECTION_METADATA-NOT: {{.*}}__swift3_reflstr
10-
// STRIP_REFLECTION_METADATA-NOT: {{.*}}__swift3_reflect
9+
// STRIP_REFLECTION_METADATA-NOT: {{.*}}swift3_reflstr
10+
// STRIP_REFLECTION_METADATA-NOT: {{.*}}swift3_reflect
1111
// STRIP_REFLECTION_METADATA-NOT: @"\01l__swift3_reflection_metadata"
1212

13-
// Field names
14-
15-
// CHECK-DAG: private constant [2 x i8] c"i\00", section "__DATA, __swift3_reflstr, coalesced, no_dead_strip"
16-
// CHECK-DAG: private constant [3 x i8] c"ms\00", section "__DATA, __swift3_reflstr, coalesced, no_dead_strip"
17-
// CHECK-DAG: private constant [3 x i8] c"me\00", section "__DATA, __swift3_reflstr, coalesced, no_dead_strip"
18-
// CHECK-DAG: private constant [3 x i8] c"mc\00", section "__DATA, __swift3_reflstr, coalesced, no_dead_strip"
19-
// CHECK-DAG: private constant [2 x i8] c"C\00", section "__DATA, __swift3_reflstr, coalesced, no_dead_strip"
20-
// CHECK-DAG: private constant [2 x i8] c"S\00", section "__DATA, __swift3_reflstr, coalesced, no_dead_strip"
21-
// CHECK-DAG: private constant [2 x i8] c"E\00", section "__DATA, __swift3_reflstr, coalesced, no_dead_strip"
22-
// CHECK-DAG: private constant [2 x i8] c"I\00", section "__DATA, __swift3_reflstr, coalesced, no_dead_strip"
23-
// CHECK-DAG: private constant [2 x i8] c"t\00", section "__DATA, __swift3_reflstr, coalesced, no_dead_strip"
24-
// CHECK-DAG: private constant [4 x i8] c"mgs\00", section "__DATA, __swift3_reflstr, coalesced, no_dead_strip"
25-
// CHECK-DAG: private constant [4 x i8] c"mge\00", section "__DATA, __swift3_reflstr, coalesced, no_dead_strip"
26-
// CHECK-DAG: private constant [4 x i8] c"mgc\00", section "__DATA, __swift3_reflstr, coalesced, no_dead_strip"
27-
// CHECK-DAG: private constant [3 x i8] c"GC\00", section "__DATA, __swift3_reflstr, coalesced, no_dead_strip"
28-
// CHECK-DAG: private constant [3 x i8] c"GS\00", section "__DATA, __swift3_reflstr, coalesced, no_dead_strip"
29-
// CHECK-DAG: private constant [3 x i8] c"GE\00", section "__DATA, __swift3_reflstr, coalesced, no_dead_strip"
30-
31-
// Type references
32-
33-
// CHECK-DAG: @"\01l__swift3_reflection_metadata" = private constant <{ {{.*}} }> <{
34-
// CHECK: i32 3,
35-
// CHECK: i32 8,
36-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @21 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 8)) to i32),
37-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @22 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 12)) to i32),
38-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([32 x i8]* @23 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 16)) to i32),
39-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @24 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 20)) to i32),
40-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @25 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 24)) to i32),
41-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @26 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 28)) to i32),
42-
// CHECK: i32 3,
43-
// CHECK: i32 8,
44-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @21 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 40)) to i32),
45-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @22 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 44)) to i32),
46-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @27 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 48)) to i32),
47-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @28 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 52)) to i32),
48-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @29 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 56)) to i32),
49-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @26 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 60)) to i32),
50-
// CHECK: i32 4,
51-
// CHECK: i32 8,
52-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @30 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 72)) to i32),
53-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @31 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 76)) to i32),
54-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @32 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 80)) to i32),
55-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @33 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 84)) to i32),
56-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @34 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 88)) to i32),
57-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @35 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 92)) to i32),
58-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @36 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 96)) to i32),
59-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @37 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 100)) to i32),
60-
// CHECK: i32 4,
61-
// CHECK: i32 8,
62-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @38 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 112)) to i32),
63-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @39 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 116)) to i32),
64-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([24 x i8]* @40 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 120)) to i32),
65-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @22 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 124)) to i32),
66-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([24 x i8]* @41 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 128)) to i32),
67-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @42 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 132)) to i32),
68-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([22 x i8]* @43 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 136)) to i32),
69-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @44 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 140)) to i32),
70-
// CHECK: i32 4,
71-
// CHECK: i32 8,
72-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @38 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 152)) to i32),
73-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @39 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 156)) to i32),
74-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @45 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 160)) to i32),
75-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @22 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 164)) to i32),
76-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([23 x i8]* @46 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 168)) to i32),
77-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @47 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 172)) to i32),
78-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @48 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 176)) to i32),
79-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @44 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 180)) to i32),
80-
// CHECK: i32 4,
81-
// CHECK: i32 8,
82-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([29 x i8]* @49 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 192)) to i32),
83-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @50 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 196)) to i32),
84-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([29 x i8]* @51 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 200)) to i32),
85-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @52 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 204)) to i32),
86-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([29 x i8]* @53 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 208)) to i32),
87-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @54 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 212)) to i32),
88-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([25 x i8]* @55 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 216)) to i32),
89-
// CHECK: i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @37 to i64), i64 add (i64 ptrtoint (<{ {{.*}} }>* @"\01l__swift3_reflection_metadata" to i64), i64 220)) to i32) }>,
90-
// CHECK: section "__DATA, __swift3_reflect, regular, no_dead_strip", align 8
13+
// CHECK-DAG: private constant [2 x i8] c"i\00", section "{{[^"]*}}swift3_reflstr{{[^"]*}}"
14+
// CHECK-DAG: private constant [3 x i8] c"ms\00", section "{{[^"]*}}swift3_reflstr{{[^"]*}}"
15+
// CHECK-DAG: private constant [3 x i8] c"me\00", section "{{[^"]*}}swift3_reflstr{{[^"]*}}"
16+
// CHECK-DAG: private constant [3 x i8] c"mc\00", section "{{[^"]*}}swift3_reflstr{{[^"]*}}"
17+
// CHECK-DAG: private constant [2 x i8] c"C\00", section "{{[^"]*}}swift3_reflstr{{[^"]*}}"
18+
// CHECK-DAG: private constant [2 x i8] c"S\00", section "{{[^"]*}}swift3_reflstr{{[^"]*}}"
19+
// CHECK-DAG: private constant [2 x i8] c"E\00", section "{{[^"]*}}swift3_reflstr{{[^"]*}}"
20+
// CHECK-DAG: private constant [2 x i8] c"I\00", section "{{[^"]*}}swift3_reflstr{{[^"]*}}"
21+
// CHECK-DAG: private constant [2 x i8] c"t\00", section "{{[^"]*}}swift3_reflstr{{[^"]*}}"
22+
// CHECK-DAG: private constant [4 x i8] c"mgs\00", section "{{[^"]*}}swift3_reflstr{{[^"]*}}"
23+
// CHECK-DAG: private constant [4 x i8] c"mge\00", section "{{[^"]*}}swift3_reflstr{{[^"]*}}"
24+
// CHECK-DAG: private constant [4 x i8] c"mgc\00", section "{{[^"]*}}swift3_reflstr{{[^"]*}}"
25+
// CHECK-DAG: private constant [3 x i8] c"GC\00", section "{{[^"]*}}swift3_reflstr{{[^"]*}}"
26+
// CHECK-DAG: private constant [3 x i8] c"GS\00", section "{{[^"]*}}swift3_reflstr{{[^"]*}}"
27+
// CHECK-DAG: private constant [3 x i8] c"GE\00", section "{{[^"]*}}swift3_reflstr{{[^"]*}}"
9128

29+
// CHECK: @"\01l__swift3_reflection_metadata" = private constant <{ {{.*}} }>

0 commit comments

Comments
 (0)