<commit_before>// RUN: not %target-swift-frontend -swift-version 3 -typecheck %s 2> %t.3.txt
// RUN: %FileCheck -check-prefix=CHECK-3 -check-prefix=CHECK-%target-runtime-3 %s < %t.3.txt
// RUN: not %target-swift-frontend -swift-version 4 -typecheck %s 2> %t.4.txt
// RUN: %FileCheck -check-prefix=CHECK-4 -check-prefix=CHECK-%target-runtime-4 %s < %t.4.txt

#if os(OSX) || os(iOS) || os(watchOS) || os(tvOS)
  import Darwin
#else
  import Glibc
#endif

func test() {
  let _: Int = strxfrm
  // CHECK-3: [[@LINE-1]]:16: error: cannot convert value of type '({{.+}}) -> UInt'{{( [(]aka .+[)])?}} to specified type 'Int'
  // CHECK-4: [[@LINE-2]]:16: error: cannot convert value of type '({{.+}}) -> Int'{{( [(]aka .+[)])?}} to specified type 'Int'

  let _: Int = strcspn
  // CHECK-3: [[@LINE-1]]:16: error: cannot convert value of type '({{.+}}) -> UInt'{{( [(]aka .+[)])?}} to specified type 'Int'
  // CHECK-4: [[@LINE-2]]:16: error: cannot convert value of type '({{.+}}) -> Int'{{( [(]aka .+[)])?}} to specified type 'Int'

  let _: Int = strspn
  // CHECK-3: [[@LINE-1]]:16: error: cannot convert value of type '({{.+}}) -> UInt'{{( [(]aka .+[)])?}} to specified type 'Int'
  // CHECK-4: [[@LINE-2]]:16: error: cannot convert value of type '({{.+}}) -> Int'{{( [(]aka .+[)])?}} to specified type 'Int'

  let _: Int = strlen
  // CHECK-3: [[@LINE-1]]:16: error: cannot convert value of type '({{.+}}) -> UInt'{{( [(]aka .+[)])?}} to specified type 'Int'
  // CHECK-4: [[@LINE-2]]:16: error: cannot convert value of type '({{.+}}) -> Int'{{( [(]aka .+[)])?}} to specified type 'Int'
}

// These functions aren't consistently available across platforms, so only
// test for them on Apple platforms.
func testApple() {
  let _: Int = strlcpy
  // CHECK-objc-3: [[@LINE-1]]:16: error: cannot convert value of type '({{.+}}) -> UInt'{{( [(]aka .+[)])?}} to specified type 'Int'
  // CHECK-objc-4: [[@LINE-2]]:16: error: cannot convert value of type '({{.+}}) -> Int'{{( [(]aka .+[)])?}} to specified type 'Int'

  let _: Int = strlcat
  // CHECK-objc-3: [[@LINE-1]]:16: error: cannot convert value of type '({{.+}}) -> UInt'{{( [(]aka .+[)])?}} to specified type 'Int'
  // CHECK-objc-4: [[@LINE-2]]:16: error: cannot convert value of type '({{.+}}) -> Int'{{( [(]aka .+[)])?}} to specified type 'Int'

  // wcslen is different: it wasn't a builtin until Swift 4, and so its return
  // type has always been 'Int'.
  let _: Int = wcslen
  // CHECK-objc-3: [[@LINE-1]]:16: error: cannot convert value of type '({{.+}}) -> Int'{{( [(]aka .+[)])?}} to specified type 'Int'
  // CHECK-objc-4: [[@LINE-2]]:16: error: cannot convert value of type '({{.+}}) -> Int'{{( [(]aka .+[)])?}} to specified type 'Int'
}<commit_msg>[test] Define out part of this test that's crashing on Linux (#12258)<commit_after>// RUN: not %target-swift-frontend -swift-version 3 -typecheck %s 2> %t.3.txt
// RUN: %FileCheck -check-prefix=CHECK-3 -check-prefix=CHECK-%target-runtime-3 %s < %t.3.txt
// RUN: not %target-swift-frontend -swift-version 4 -typecheck %s 2> %t.4.txt
// RUN: %FileCheck -check-prefix=CHECK-4 -check-prefix=CHECK-%target-runtime-4 %s < %t.4.txt

#if os(OSX) || os(iOS) || os(watchOS) || os(tvOS)
  import Darwin
#else
  import Glibc
#endif

func test() {
  let _: Int = strxfrm
  // CHECK-3: [[@LINE-1]]:16: error: cannot convert value of type '({{.+}}) -> UInt'{{( [(]aka .+[)])?}} to specified type 'Int'
  // CHECK-4: [[@LINE-2]]:16: error: cannot convert value of type '({{.+}}) -> Int'{{( [(]aka .+[)])?}} to specified type 'Int'

  let _: Int = strcspn
  // CHECK-3: [[@LINE-1]]:16: error: cannot convert value of type '({{.+}}) -> UInt'{{( [(]aka .+[)])?}} to specified type 'Int'
  // CHECK-4: [[@LINE-2]]:16: error: cannot convert value of type '({{.+}}) -> Int'{{( [(]aka .+[)])?}} to specified type 'Int'

  let _: Int = strspn
  // CHECK-3: [[@LINE-1]]:16: error: cannot convert value of type '({{.+}}) -> UInt'{{( [(]aka .+[)])?}} to specified type 'Int'
  // CHECK-4: [[@LINE-2]]:16: error: cannot convert value of type '({{.+}}) -> Int'{{( [(]aka .+[)])?}} to specified type 'Int'

  let _: Int = strlen
  // CHECK-3: [[@LINE-1]]:16: error: cannot convert value of type '({{.+}}) -> UInt'{{( [(]aka .+[)])?}} to specified type 'Int'
  // CHECK-4: [[@LINE-2]]:16: error: cannot convert value of type '({{.+}}) -> Int'{{( [(]aka .+[)])?}} to specified type 'Int'
}

#if os(OSX) || os(iOS) || os(watchOS) || os(tvOS)
// These functions aren't consistently available across platforms, so only
// test for them on Apple platforms.
func testApple() {
  let _: Int = strlcpy
  // CHECK-objc-3: [[@LINE-1]]:16: error: cannot convert value of type '({{.+}}) -> UInt'{{( [(]aka .+[)])?}} to specified type 'Int'
  // CHECK-objc-4: [[@LINE-2]]:16: error: cannot convert value of type '({{.+}}) -> Int'{{( [(]aka .+[)])?}} to specified type 'Int'

  let _: Int = strlcat
  // CHECK-objc-3: [[@LINE-1]]:16: error: cannot convert value of type '({{.+}}) -> UInt'{{( [(]aka .+[)])?}} to specified type 'Int'
  // CHECK-objc-4: [[@LINE-2]]:16: error: cannot convert value of type '({{.+}}) -> Int'{{( [(]aka .+[)])?}} to specified type 'Int'

  // wcslen is different: it wasn't a builtin until Swift 4, and so its return
  // type has always been 'Int'.
  let _: Int = wcslen
  // CHECK-objc-3: [[@LINE-1]]:16: error: cannot convert value of type '({{.+}}) -> Int'{{( [(]aka .+[)])?}} to specified type 'Int'
  // CHECK-objc-4: [[@LINE-2]]:16: error: cannot convert value of type '({{.+}}) -> Int'{{( [(]aka .+[)])?}} to specified type 'Int'
}
#endif
{'fraction_non_alphanumeric': 0.26392644672796106, 'fraction_numerical': 0.025779700739138274, 'mean_word_length': 3.5737840065952184, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 35, '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': '7377850', 'n_tokens_mistral': 2249, 'n_tokens_neox': 2112, 'n_words': 639}