<commit_before><commit_msg>Split out the autorelease test and XFAIL it on i386, which does not support the autorelease optimization.<commit_after>// RUN: %target-run-simple-swift foo | FileCheck %s

// The Objective-C runtime does not implement the autorelease
// optimization on i386, even in the iOS simulator.
// XFAIL: i386

import Foundation

// rdar://16565958
class PrintOnDeinit: NSObject {
  // Result should get autoreleased.
  @objc class func create() -> PrintOnDeinit {
    return PrintOnDeinit()
  }

  deinit { println("object died") }
}
func useTemp() {
  let f = PrintOnDeinit.create()
}

// objc_retainAutoreleasedReturnValue will fail to reclaim the first
// object autoreleased from each shared object on x86-64, so prime it.
autoreleasepool { useTemp() }
autoreleasepool {
  println("autorelease test begin")
  useTemp()
  println("after call to useTemp")
}
println("autorelease test end")
// CHECK:      autorelease test begin
// CHECK-NEXT: object died
// CHECK-NEXT: after call to useTemp
// CHECK-NEXT: autorelease test end

{'fraction_non_alphanumeric': 0.09818875119161107, 'fraction_numerical': 0.02001906577693041, 'mean_word_length': 4.0, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '3090920', 'n_tokens_mistral': 337, 'n_tokens_neox': 313, 'n_words': 113}