|
1 |
| -// RUN: %target-swift-frontend -primary-file %s -O -emit-ir | %FileCheck %s --check-prefixes=CHECK,CHECK-LARGE-ALLOC,CHECK-LARGE-ALLOC-%target-vendor |
2 |
| -// RUN: %target-swift-frontend -primary-file %s -O -emit-ir | %FileCheck %s --check-prefix=CHECK-LARGE-STACK-ALLOC -DWORD=i%target-ptrsize |
3 |
| -// RUN: %target-swift-frontend -primary-file %s -O -emit-ir | %FileCheck %s --check-prefix=CHECK-LARGE-HEAP-ALLOC -DWORD=i%target-ptrsize |
4 |
| -// REQUIRES: CPU=x86_64 |
5 |
| -// REQUIRES: rdar104435186 |
| 1 | +// RUN: %target-swift-frontend -primary-file %s -O -emit-ir | %FileCheck %s |
6 | 2 |
|
7 | 3 | @_silgen_name("blackHole")
|
8 | 4 | func blackHole(_ value: UnsafeMutableRawPointer?) -> Void
|
@@ -70,24 +66,3 @@ withUnsafeTemporaryAllocation(of: Void.self, capacity: 2) { buffer in
|
70 | 66 | // CHECK: [[VOID_PTR:%[0-9]+]] = ptrtoint [2 x i8]* [[VOID_PTR_RAW]] to [[WORD]]
|
71 | 67 | // CHECK: call swiftcc void @blackHole([[WORD]] [[VOID_PTR]])
|
72 | 68 |
|
73 |
| -// MARK: Very large allocation |
74 |
| - |
75 |
| -// A large allocation size should produce an OS version check, call to |
76 |
| -// swift_stdlib_isStackAllocationSafe(), and then a branch based on the result |
77 |
| -// to either stack-allocate or heap-allocate. |
78 |
| -withUnsafeTemporaryAllocation(byteCount: 0x0FFF_FFFF, alignment: 1) { buffer in |
79 |
| - blackHole(buffer.baseAddress) |
80 |
| -} |
81 |
| -// CHECK-LARGE-HEAP-ALLOC: [[HEAP_PTR_RAW:%[0-9]+]] = call noalias i8* @swift_slowAlloc([[WORD]] 268435455, [[WORD]] -1) |
82 |
| -// CHECK-LARGE-HEAP-ALLOC-NEXT: [[HEAP_PTR:%[0-9]+]] = ptrtoint i8* [[HEAP_PTR_RAW]] to [[WORD]] |
83 |
| -// CHECK-LARGE-HEAP-ALLOC-NEXT: call swiftcc void @blackHole([[WORD]] [[HEAP_PTR]]) |
84 |
| -// CHECK-LARGE-HEAP-ALLOC-NEXT: call void @swift_slowDealloc(i8* [[HEAP_PTR_RAW]], [[WORD]] -1, [[WORD]] -1) |
85 |
| - |
86 |
| -// CHECK-LARGE-STACK-ALLOC: [[STACK_PTR_RAW:%temp_alloc[0-9]*]] = alloca [268435455 x i8], align 1 |
87 |
| -// CHECK-LARGE-STACK-ALLOC-NEXT: [[STACK_PTR:%[0-9]+]] = ptrtoint [268435455 x i8]* [[STACK_PTR_RAW]] to [[WORD]] |
88 |
| -// CHECK-LARGE-STACK-ALLOC-NEXT: call swiftcc void @blackHole([[WORD]] [[STACK_PTR]]) |
89 |
| - |
90 |
| -// CHECK-LARGE-ALLOC-DAG: [[IS_SAFE:%[0-9]+]] = call zeroext i1 @swift_stdlib_isStackAllocationSafe([[WORD]] 268435455, [[WORD]] 1) |
91 |
| -// CHECK-LARGE-ALLOC-DAG: br i1 [[IS_SAFE]], label %{{[0-9]+}}, label %{{[0-9]+}} |
92 |
| -// CHECK-LARGE-ALLOC-apple-DAG: [[IS_OS_OK:%[0-9]+]] = call swiftcc i1 @"$ss26_stdlib_isOSVersionAtLeastyBi1_Bw_BwBwtF" |
93 |
| -// CHECK-LARGE-ALLOC-apple-DAG: br i1 [[IS_OS_OK]], label %{{[0-9]+}}, label %{{[0-9]+}} |
0 commit comments