Skip to content

Commit 4645482

Browse files
committed
---
yaml --- r: 347899 b: refs/heads/master c: 5db4e8d h: refs/heads/master i: 347897: 947bf61 347895: 674d256
1 parent 2a5ea87 commit 4645482

File tree

7 files changed

+56
-10
lines changed

7 files changed

+56
-10
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 47bef3ff0f2378fcec6ae01081ffb311ddaa2b55
2+
refs/heads/master: 5db4e8dba945143896911d0374ae60ccc67f0948
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/lib/IRGen/GenDecl.cpp

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2398,7 +2398,8 @@ llvm::Function *IRGenModule::getAddrOfSILFunction(
23982398

23992399
static llvm::GlobalVariable *createGOTEquivalent(IRGenModule &IGM,
24002400
llvm::Constant *global,
2401-
LinkEntity entity) {
2401+
LinkEntity entity)
2402+
{
24022403
// Determine the name of this entity.
24032404
llvm::SmallString<64> globalName;
24042405
entity.mangle(globalName);
@@ -2421,7 +2422,17 @@ static llvm::GlobalVariable *createGOTEquivalent(IRGenModule &IGM,
24212422
llvm::GlobalValue::PrivateLinkage,
24222423
global,
24232424
llvm::Twine("got.") + globalName);
2424-
gotEquivalent->setUnnamedAddr(llvm::GlobalValue::UnnamedAddr::Global);
2425+
2426+
// rdar://problem/50968433: Unnamed_addr constants appear to get emitted
2427+
// with incorrect alignment by the LLVM JIT in some cases. Don't use
2428+
// unnamed_addr as a workaround.
2429+
if (!IGM.getOptions().UseJIT) {
2430+
gotEquivalent->setUnnamedAddr(llvm::GlobalValue::UnnamedAddr::Global);
2431+
} else {
2432+
ApplyIRLinkage(IRLinkage::InternalLinkOnceODR)
2433+
.to(gotEquivalent);
2434+
}
2435+
24252436
return gotEquivalent;
24262437
}
24272438

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// RUN: %target-run-simple-swift
2+
// REQUIRES: executable_test
3+
4+
struct Container<Base, Value, Content>
5+
where Base: Collection
6+
{
7+
var base: Base
8+
var elementPath: KeyPath<Base.Element, Value>
9+
var content: (Value) -> Content
10+
}
11+
12+
let x = Container(base: 1...10, elementPath: \.bitWidth) {
13+
return String($0, radix: 2)
14+
}
15+
16+
// CHECK: i hope we passed the audition
17+
print("i hope we passed the audition")
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: %target-swift-frontend -emit-module-path %t/resilient_struct.swiftmodule %S/../Inputs/resilient_struct.swift -enable-library-evolution
3+
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-module-path %t/resilient_objc_class.swiftmodule %S/../Inputs/resilient_objc_class.swift -I %t -enable-library-evolution -emit-objc-header-path %t/resilient_objc_class.h
4+
5+
// RUN: cp %S/Inputs/custom-modules/module.map %t/module.map
6+
7+
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck %S/resilient-ancestry.swift -module-name resilient -emit-objc-header-path %t/resilient.h -I %t -enable-library-evolution -enable-resilient-objc-class-stubs
8+
// RUN: %FileCheck %S/resilient-ancestry.swift < %t/resilient.h
9+
// RUN: %check-in-clang %t/resilient.h -I %t
10+
11+
// REQUIRES: objc_interop
12+
// REQUIRES: swift_stable_abi

trunk/test/PrintAsObjC/resilient-ancestry.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@
1010
// RUN: %FileCheck %s --check-prefix=NO-STUBS < %t/resilient.h
1111
// RUN: %check-in-clang %t/resilient.h -I %t
1212

13-
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck %s -module-name resilient -emit-objc-header-path %t/resilient.h -I %t -enable-library-evolution -enable-resilient-objc-class-stubs
14-
// RUN: %FileCheck %s < %t/resilient.h
15-
// RUN: %check-in-clang %t/resilient.h -I %t
16-
1713
// REQUIRES: objc_interop
1814

15+
// See also resilient-ancestry.swift, for the stable ABI deployment target test.
16+
1917
import Foundation
2018
import resilient_objc_class
2119

trunk/test/decl/protocol/conforms/nscoding.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -parse-as-library -swift-version 4 %s -verify
44
// RUN: not %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -parse-as-library -swift-version 4 %s -disable-nskeyedarchiver-diagnostics 2>&1 | %FileCheck -check-prefix CHECK-NO-DIAGS %s
5-
65
// RUN: not %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -parse-as-library -swift-version 4 %s -dump-ast -target %target-pre-stable-abi-triple > %t/old.ast
7-
// RUN: not %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -parse-as-library -swift-version 4 %s -dump-ast -target %target-stable-abi-triple > %t/new.ast
86

97
// RUN: %FileCheck --check-prefix=CHECK-OLD %s < %t/old.ast
108
// RUN: %FileCheck --check-prefix=NEGATIVE %s < %t/old.ast
11-
// RUN: %FileCheck --check-prefix=NEGATIVE --check-prefix=NEGATIVE-NEW %s < %t/new.ast
129

1310
// REQUIRES: objc_interop
1411

12+
// See also nscoding_stable_abi.swift, for the stable ABI deployment
13+
// target test.
14+
1515
// CHECK-NO-DIAGS-NOT: NSCoding
1616
// CHECK-NO-DIAGS-NOT: unstable
1717

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// RUN: %empty-directory(%t)
2+
3+
// RUN: not %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -parse-as-library -swift-version 4 %S/nscoding.swift -dump-ast -target %target-stable-abi-triple > %t/new.ast
4+
5+
// RUN: %FileCheck --check-prefix=NEGATIVE --check-prefix=NEGATIVE-NEW %S/nscoding.swift < %t/new.ast
6+
7+
// REQUIRES: objc_interop
8+
// REQUIRES: swift_stable_abi

0 commit comments

Comments
 (0)