mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
When constructing the body of the merged function, the internal function is given internal linkage always. It is only accessible through the adjusting thunks which retain the original DLL storage. Ensure that we reset the DLL storage which it inherited from the first function.
24 lines
609 B
LLVM
24 lines
609 B
LLVM
; RUN: %swift-llvm-opt -mtriple i686-windows -swift-merge-functions -swiftmergefunc-threshold=4 %s | %FileCheck %s
|
|
|
|
@g = external global i32
|
|
|
|
define dllexport i32 @f(i32 %x, i32 %y) {
|
|
%sum = add i32 %x, %y
|
|
%sum2 = add i32 %sum, %y
|
|
%l = load i32, i32* @g, align 4
|
|
%sum3 = add i32 %sum2, %y
|
|
ret i32 %sum3
|
|
}
|
|
|
|
define dllexport i32 @h(i32 %x, i32 %y) {
|
|
%sum = add i32 %x, %y
|
|
%sum2 = add i32 %sum, %y
|
|
%l = load i32, i32* @g, align 4
|
|
%sum3 = add i32 %sum2, %y
|
|
ret i32 %sum3
|
|
}
|
|
|
|
; CHECK-NOT: define internal dllexport i32 @f_merged(i32, i32)
|
|
; CHECK-LABEL: define internal i32 @f_merged(i32, i32)
|
|
|