// RUN: %target-swift-frontend -sdk %S/../SILGen/Inputs -I %S/../SILGen/Inputs -enable-source-import -primary-file %s -emit-sil -emit-verbose-sil | FileCheck %s -check-prefix=CHECK-DEBUG
// RUN: %target-swift-frontend -sdk %S/../SILGen/Inputs -I %S/../SILGen/Inputs -enable-source-import -primary-file %s -emit-sil -emit-verbose-sil -O | FileCheck %s -check-prefix=CHECK-RELEASE

// XFAIL: linux

import gizmo

// Test that binaries compiled in release mode don't leak filenames of users'
// code through calls to runtime trap function for unimplemented initializers.

class DesignatedStubs : Gizmo {
  override init() { super.init() }
}
// CHECK-DEBUG: sil hidden @_TFC25unimplemented_initializer15DesignatedStubscfMS0_FT7bellsOnSi_GSQS0__
// CHECK-DEBUG: string_literal utf8 "{{.*}}unimplemented_initializer.swift"

// CHECK-RELEASE: sil hidden [thunk] @_TFC25unimplemented_initializer15DesignatedStubscfMS0_FT7bellsOnSi_GSQS0__
// CHECK-RELEASE-NOT: unimplemented_initializer.swift"


// RUN: %target-swift-frontend -sdk %S/../SILGen/Inputs -I %S/../SILGen/Inputs -enable-source-import -primary-file %s -emit-sil -emit-verbose-sil | FileCheck %s -check-prefix=CHECK-DEBUG
// RUN: %target-swift-frontend -sdk %S/../SILGen/Inputs -I %S/../SILGen/Inputs -enable-source-import -primary-file %s -emit-sil -emit-verbose-sil -O | FileCheck %s -check-prefix=CHECK-RELEASE

// XFAIL: linux

import gizmo

// Test that binaries compiled in release mode don't leak filenames of users'
// code through calls to runtime trap function for unimplemented initializers.

class DesignatedStubs : Gizmo {
  override init() { super.init() }
}
// CHECK-DEBUG: string_literal utf8 "{{.*}}unimplemented_initializer.swift"

// CHECK-RELEASE-NOT: unimplemented_initializer.swift"


Fix a test case that relied on a specific behavior of the optimizer.
Fix a test case that relied on a specific behavior of the optimizer.

The test unimplemented_initializer.swift checks that we don't leak file names
through calls to runtime trap function. Before this commit the test checked for
a specific sil function mame with specific attributes. The test expected that
the optimizer would preserve the function declaration, but "Function Signature
Optimization" changed the function signature and turned the original function
into a thunk. I removed the checks for a specific function name and kept the
CHECK and CHECK-NOT lines that preserve the original intent of the test.

Swift SVN r31521
