28 lines · plain
1; RUN: opt < %s -passes='bounds-checking<merge>' -S | FileCheck %s2 3target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128"4 5%struct.s2_packed = type <{ i64, i32, i32, i32, i16, i8 }>6 7; CHECK-LABEL: @f8; CHECK-NOT: trap9define i16 @f() {10entry:11 %packed1 = alloca %struct.s2_packed, align 812 %gep = getelementptr inbounds %struct.s2_packed, ptr %packed1, i32 0, i32 413 %val = load i32, ptr %gep, align 414 %valt = trunc i32 %val to i1615 ret i16 %valt16}17 18; CHECK-LABEL: @f19; CHECK: call void @llvm.trap()20define i16 @f2() {21entry:22 %packed1 = alloca %struct.s2_packed, align 823 %gep = getelementptr inbounds %struct.s2_packed, ptr %packed1, i32 0, i32 424 %val = load i48, ptr %gep, align 425 %valt = trunc i48 %val to i1626 ret i16 %valt27}28