mirror of
https://github.com/apple/swift.git
synced 2026-10-26 20:15:53 +01:00
This lets the test run faster while still checking that there is no exponential complexity, in line with the large_string_array and large_nested_array tests, which switched to this style in #91356.
37 lines
1.0 KiB
Swift
37 lines
1.0 KiB
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: %timer-scale-test --begin 10000 --end 20000 --superlinear-threshold 1.5 --save-temps --ignore-no-data --trace --select SIL-and-LLVM-processing.instr -O %s
|
|
|
|
// UNSUPPORTED: OS=freebsd
|
|
|
|
// Regression test for rdar://175803465 (Large InlineArray compilation takes forever)
|
|
|
|
// Check if the optimizer can optimize the whole array into a statically
|
|
// initialized global.
|
|
|
|
// We emit assembly rather than SIL because the bottleneck in rdar://175803465
|
|
// was LLVM machine code generation.
|
|
|
|
// RUN: %gyb -D N=10000 %s > %t/main.swift
|
|
|
|
// RUN: %target-swift-frontend -O -parse-as-library -disable-availability-checking -S %t/main.swift | %FileCheck %s
|
|
|
|
// REQUIRES: swift_stdlib_no_asserts,optimized_stdlib
|
|
|
|
// REQUIRES: CPU=arm64 || CPU=x86_64 || CPU=aarch64
|
|
|
|
// Check if the optimizer can optimize the whole array into a statically
|
|
// initialized global
|
|
|
|
// CHECK: $s4main3arrs11InlineArrayVy$9999_SiGvp:
|
|
// CHECK-NEXT: 8
|
|
// CHECK-NEXT: 1
|
|
// CHECK-NEXT: 2
|
|
|
|
public let arr: [_ of Int] = [
|
|
|
|
% for i in range(int(N)):
|
|
${i},
|
|
%end
|
|
|
|
]
|