<commit_before>// RUN: %target-swift-frontend  %s -Onone  -emit-sil | FileCheck %s

// REQUIRES: optimized_stdlib

// Check that pre-specialization works at -Onone.
// This test requires the standard library to be compiled with pre-specializations!

// CHECK-LABEL: sil [noinline] @_TF13prespecialize4testFTRGSaSi_4sizeSi_T_ 
// Look for generic specialization <Swift.Int with Swift.Int : Swift.ForwardIndex in Swift, Swift.Int with Swift.Int : Swift._SignedInteger in Swift, Swift.Int with Swift.Int : Swift._BuiltinIntegerLiteralConvertible in Swift, Swift.Int> of Swift.Range.iterator <A where A: Swift.ForwardIndex> (Swift.Range<A>)() -> Swift.RangeIterator<A>
// CHECK: function_ref @_TTSg5SiSis12ForwardIndexs_SiSis18_SignedIntegerTypes_SiSis33_BuiltinIntegerLiteralConvertibles_Si___TFVs5Range8iterator
// Look for generic specialization <Swift.Int with Swift.Int : Swift.ForwardIndex in Swift, Swift.Int with Swift.Int : Swift._SignedInteger in Swift, Swift.Int with Swift.Int : Swift._BuiltinIntegerLiteralConvertible in Swift, Swift.Int> of Swift.RangeIterator.next <A where A: Swift.ForwardIndex> (inout Swift.RangeIterator<A>)() -> Swift.Optional<A>
// CHECK: function_ref @_TTSg5SiSis12ForwardIndexs_SiSis18_SignedIntegerTypes_SiSis33_BuiltinIntegerLiteralConvertibles_Si___TFVs13RangeIterator4next
// Look for generic specialization <Swift.Int> of Swift.Array.subscript.getter : (Swift.Int) -> A
// CHECK: function_ref {{@_TTSg5Si___TFSag9subscriptFSix|@_TTSg5Si___TFSaap9subscriptFSix}}
// CHECK: return
@inline(never)
public func test(inout a: [Int], size: Int) {
  for i in 0..<size {
    for j in 0..<size {
      a[i] = a[j]
    }
  }
}

// CHECK-LABEL: sil [noinline] @_TF13prespecialize3runFT_T_
// Look for generic specialization <Swift.Int> of Swift.Array.init (repeating : A, count : Swift.Int) -> Swift.Array<A>
// CHECK: function_ref @_TTSg5Si___TFSaCfT9repeatingx5countSi_GSax_
// CHECK: return
@inline(never)
public func run() {
  let size = 10000
  var p = [Int](repeating: 0, count: size)
  for i in 0..<size {
    p[i] = i
  }
  test(&p, size: size)
}

run()

<commit_msg>fixing test for integer type<commit_after>// RUN: %target-swift-frontend  %s -Onone  -emit-sil | FileCheck %s

// REQUIRES: optimized_stdlib

// Check that pre-specialization works at -Onone.
// This test requires the standard library to be compiled with pre-specializations!

// CHECK-LABEL: sil [noinline] @_TF13prespecialize4testFTRGSaSi_4sizeSi_T_ 
// Look for generic specialization <Swift.Int with Swift.Int : Swift.ForwardIndex in Swift, Swift.Int with Swift.Int : Swift._SignedInteger in Swift, Swift.Int with Swift.Int : Swift._BuiltinIntegerLiteralConvertible in Swift, Swift.Int> of Swift.Range.iterator <A where A: Swift.ForwardIndex> (Swift.Range<A>)() -> Swift.RangeIterator<A>
// CHECK: function_ref @_TTSg5SiSis12ForwardIndexs_SiSis14_SignedIntegers_SiSis33_BuiltinIntegerLiteralConvertibles_Si___TFVs5Range8iterator
// Look for generic specialization <Swift.Int with Swift.Int : Swift.ForwardIndex in Swift, Swift.Int with Swift.Int : Swift._SignedInteger in Swift, Swift.Int with Swift.Int : Swift._BuiltinIntegerLiteralConvertible in Swift, Swift.Int> of Swift.RangeIterator.next <A where A: Swift.ForwardIndex> (inout Swift.RangeIterator<A>)() -> Swift.Optional<A>
// CHECK: function_ref @_TTSg5SiSis12ForwardIndexs_SiSis14_SignedIntegers_SiSis33_BuiltinIntegerLiteralConvertibles_Si___TFVs13RangeIterator4next
// Look for generic specialization <Swift.Int> of Swift.Array.subscript.getter : (Swift.Int) -> A
// CHECK: function_ref {{@_TTSg5Si___TFSag9subscriptFSix|@_TTSg5Si___TFSaap9subscriptFSix}}
// CHECK: return
@inline(never)
public func test(inout a: [Int], size: Int) {
  for i in 0..<size {
    for j in 0..<size {
      a[i] = a[j]
    }
  }
}

// CHECK-LABEL: sil [noinline] @_TF13prespecialize3runFT_T_
// Look for generic specialization <Swift.Int> of Swift.Array.init (repeating : A, count : Swift.Int) -> Swift.Array<A>
// CHECK: function_ref @_TTSg5Si___TFSaCfT9repeatingx5countSi_GSax_
// CHECK: return
@inline(never)
public func run() {
  let size = 10000
  var p = [Int](repeating: 0, count: size)
  for i in 0..<size {
    p[i] = i
  }
  test(&p, size: size)
}

run()


{'fraction_non_alphanumeric': 0.11155945881794446, 'fraction_numerical': 0.019938286256824117, 'mean_word_length': 4.926863572433192, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5089531', 'n_tokens_mistral': 1580, 'n_tokens_neox': 1442, 'n_words': 356}