1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py 2; RUN: opt < %s -passes='sroa<preserve-cfg>' -S | FileCheck %s --check-prefixes=CHECK,CHECK-PRESERVE-CFG 3; RUN: opt < %s -passes='sroa<modify-cfg>' -S | FileCheck %s --check-prefixes=CHECK,CHECK-MODIFY-CFG 4target datalayout = "e-p:64:64:64:32" 5 6%struct.test = type { %struct.basic, %struct.basic } 7%struct.basic = type { i16, i8 } 8 9define i16 @test(ptr %ts2.i) { 10; CHECK-LABEL: @test( 11; CHECK-NEXT: entry: 12; CHECK-NEXT: [[S_SROA_0:%.*]] = alloca [3 x i8], align 8 13; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 1 [[TS2_I:%.*]], ptr align 8 [[S_SROA_0]], i32 3, i1 false) 14; CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[TS2_I]], align 2 15; CHECK-NEXT: ret i16 [[TMP0]] 16; 17entry: 18 %s = alloca %struct.test 19 call void @llvm.memcpy.p0.p0.i32(ptr %ts2.i, ptr %s, i32 3, i1 false) 20 %0 = load i16, ptr %ts2.i 21 ret i16 %0 22} 23 24declare void @llvm.memcpy.p0.p0.i32(ptr nocapture writeonly, ptr nocapture readonly, i32, i1) 25;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: 26; CHECK-MODIFY-CFG: {{.*}} 27; CHECK-PRESERVE-CFG: {{.*}} 28