Files
swift-mirror/test/LLVMPasses/merge_func_coff.ll
Saleem Abdulrasool 8e1a88e985 LLVMPasses: fix DLL storage for merged functions
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.
2016-10-06 08:09:23 -07:00

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)