Skip to content

Revert changes to swap_refcnt test. #3721

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 24, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 2 additions & 15 deletions test/SILOptimizer/swap_refcnt.swift
Original file line number Diff line number Diff line change
@@ -1,25 +1,12 @@
// RUN: %target-swift-frontend -O -emit-sil %s | FileCheck %s
// REQUIRES: rdar:27506150> SILOptimizer/swap_refcnt.swift failes after noreturn -> Never changes

// Make sure we can swap two values in an array without retaining anything.

// FIXME: In optimized builds, we inline some stuff, and end up with
// the following instruction sequence -- %130 is a never-returning
// function:
//
// strong_retain %23 : $Builtin.NativeObject
// strong_retain %23 : $Builtin.NativeObject
// strong_retain %23 : $Builtin.NativeObject
// %130 = apply %121(%125, %114, %118, %120, %126)
//
// But really the strong_retains here should be optimized away.

// XFAIL: optimized_stdlib


// CHECK-LABEL: sil @_TF11swap_refcnt11swapByIndex
// CHECK-NOT: strong_retain
// CHECK-NOT: strong_release
// CHECK: return %
// CHECK: return
public func swapByIndex(A: inout [Int8], x : Int, y : Int) {
swap(&A[x],&A[y])
}
Expand Down