Skip to content

Commit a1eed1f

Browse files
authored
Merge pull request #75797 from eeckstein/fix-tests-for-rebranch
tests: adapt some optimizer tests for rebranch
2 parents f8e0980 + da0dea1 commit a1eed1f

File tree

5 files changed

+20
-4
lines changed

5 files changed

+20
-4
lines changed

test/SILOptimizer/character_literals.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ public func singleNonAsciiChar() -> Character {
4545
//
4646
// CHECK-LABEL: define {{.*}}singleNonSmolChar
4747
// CHECK-NEXT: entry:
48-
// CHECK: ret { i64, ptr } { i64 1152921504606847001, ptr {{.*}}@".str.25.\F0\9F\91\A9\E2\80\8D\F0\9F\91\A9\E2\80\8D\F0\9F\91\A6\E2\80\8D\F0\9F\91\A6" {{.*}}i64 {{-9223372036854775808|36028797018963968}}
48+
// CHECK-DAG: 1152921504606847001
49+
// CHECK-DAG: @".str.25.\F0\9F\91\A9\E2\80\8D\F0\9F\91\A9\E2\80\8D\F0\9F\91\A6\E2\80\8D\F0\9F\91\A6"
50+
// CHECK-DAG: {{-9223372036854775808|36028797018963968}}
4951
public func singleNonSmolChar() -> Character {
5052
return "👩‍👩‍👦‍👦"
5153
}

test/SILOptimizer/concat_string_literals.64.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
// so these tests will need to be adapted for that.
1212
// XFAIL: OS=linux-android && CPU=aarch64
1313

14+
15+
// CHECK: [[S1:^@".*"]] = {{.*}} c"a{{.*}}+{{.*}}={{.*}}\00"
16+
// CHECK: [[S2:^@".*"]] = {{.*}} c"abcd{{.*}}fgh{{.*}}klmno{{.*}}qr\00"
17+
1418
// NOTE: 25185.byteSwapped = 0x62 'a', 0x61 'b'
1519
// CHECK-LABEL: test_ascii_scalar_scalar2
1620
// CHECK: ret { i64, ptr } { i64 25185, ptr inttoptr (i64 -{{[0-9]+}} to ptr) }
@@ -42,7 +46,8 @@ public func test_strng_strng2() -> String {
4246

4347
// NOTE: 1152921504606847019 = 43 (code-unit length) | `isTailAllocated` perf flag
4448
// CHECK-LABEL: test_scalar_strng
45-
// CHECK: ret { i64, ptr } { i64 1152921504606847019, ptr inttoptr {{.*}}i64 -{{[0-9]+}}{{.*}} to ptr) }
49+
// CHECK-DAG: 1152921504606847019
50+
// CHECK-DAG: [[S1]]
4651
public func test_scalar_strng() -> String {
4752
return "a" + "👨🏿‍💼+🧙🏿‍♂️=🕴🏿"
4853
}
@@ -56,7 +61,8 @@ public func test_strng_concat_smol() -> String {
5661

5762
// NOTE: 1152921504606846999 = 23 (code-unit length) | `isTailAllocated` perf flag
5863
// CHECK-LABEL: test_strng_concat_large
59-
// CHECK: ret { i64, ptr } { i64 1152921504606846999, ptr inttoptr {{.*}}i64 -{{[0-9]+}}{{.*}} to ptr) }
64+
// CHECK-DAG: 1152921504606846999
65+
// CHECK-DAG: [[S2]]
6066
public func test_strng_concat_large() -> String {
6167
return "a" + "bc" + "dèf" + "ghī" + "jklmn" + "o" + "𝛒qr"
6268
}

test/SILOptimizer/static_objects.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public let c = C(x: 27)
3636
// CHECK: } // end sil function '$s4test6testitAA1CCyF'
3737

3838
// CHECK-LLVM-LABEL: define {{.*}} @"$s4test6testitAA1CCyF"
39-
// CHECK-LLVM: [[C:%.*]] = tail call ptr @swift_initStaticObject({{.*}} getelementptr {{.*}}, ptr @"$s4test1c_WZTv_", i64 0, i32 1))
39+
// CHECK-LLVM: [[C:%.*]] = tail call ptr @swift_initStaticObject({{.*}} getelementptr {{.*}}, ptr @"$s4test1c_WZTv_"
4040
// CHECK-LLVM-NEXT: ret ptr [[C]]
4141
// CHECK-LLVM: }
4242
@inline(never)

test/SILOptimizer/static_strings.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
// REQUIRES: CPU=arm64 || CPU=x86_64
1010
// REQUIRES: swift_in_compiler
1111

12+
// The required relocation format for a single return LLVM instruction are not necessarily
13+
// supported on object file formats other than Mach-O.
14+
// REQUIRES: OS=macosx || OS=ios || OS=tvos || OS=watchOS || OS=xros
15+
1216
// This is an end-to-end test to ensure that the optimizer generates
1317
// optimal code for static String variables.
1418

test/SILOptimizer/string_literals.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
// REQUIRES: swift_stdlib_no_asserts,optimized_stdlib
44
// REQUIRES: swift_in_compiler
55

6+
// The required relocation format for a single return LLVM instruction are not necessarily
7+
// supported on object file formats other than Mach-O.
8+
// REQUIRES: OS=macosx || OS=ios || OS=tvos || OS=watchOS || OS=xros
9+
610
// FIXME(rdar://problem/45856408): The 7-bit discriminator complicates codegen
711
// on 32-bit platforms.
812
// UNSUPPORTED: PTRSIZE=32

0 commit comments

Comments
 (0)