; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -passes='sroa<preserve-cfg>' -S | FileCheck %s --check-prefixes=CHECK,CHECK-PRESERVE-CFG
; RUN: opt < %s -passes='sroa<modify-cfg>' -S | FileCheck %s --check-prefixes=CHECK,CHECK-MODIFY-CFG
target datalayout = "E-m:e-i64:64-n32:64"
target triple = "powerpc64-unknown-linux-gnu"
%struct.ld2 = type { [2 x ppc_fp128] }
declare void @bar(ptr, [2 x i128])
define void @foo(ptr %v) #0 {
; CHECK-LABEL: @foo(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[TMP0:%.*]] = bitcast ppc_fp128 0xM403B0000000000000000000000000000 to i128
; CHECK-NEXT: [[DOTFCA_0_INSERT:%.*]] = insertvalue [2 x i128] poison, i128 [[TMP0]], 0
; CHECK-NEXT: [[TMP1:%.*]] = bitcast ppc_fp128 0xM4093B400000000000000000000000000 to i128
; CHECK-NEXT: [[DOTFCA_1_INSERT:%.*]] = insertvalue [2 x i128] [[DOTFCA_0_INSERT]], i128 [[TMP1]], 1
; CHECK-NEXT: call void @bar(ptr [[V:%.*]], [2 x i128] [[DOTFCA_1_INSERT]])
; CHECK-NEXT: ret void
;
entry:
%v.addr = alloca ptr, align 8
%z = alloca %struct.ld2, align 16
store ptr %v, ptr %v.addr, align 8
store ppc_fp128 0xM403B0000000000000000000000000000, ptr %z, align 16
%arrayidx2 = getelementptr inbounds [2 x ppc_fp128], ptr %z, i32 0, i64 1
store ppc_fp128 0xM4093B400000000000000000000000000, ptr %arrayidx2, align 16
%0 = load ptr, ptr %v.addr, align 8
%1 = load [2 x i128], ptr %z, align 1
call void @bar(ptr %0, [2 x i128] %1)
ret void
}
attributes #0 = { nounwind }
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
; CHECK-MODIFY-CFG: {{.*}}
; CHECK-PRESERVE-CFG: {{.*}}