Skip to content

Commit 4e62d21

Browse files
committed
[ConstantFold] Add test for load of padding (NFC)
This currently load zero rather than undef.
1 parent 8f6af1d commit 4e62d21

File tree

1 file changed

+10
-0
lines changed
  • llvm/test/Transforms/InstSimplify/ConstProp

1 file changed

+10
-0
lines changed

llvm/test/Transforms/InstSimplify/ConstProp/loads.ll

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,3 +315,13 @@ define i8 @load_neg_one_at_unknown_offset() {
315315
%v = load i8, i8* getelementptr (<4 x i8>, <4 x i8>* @g_neg_one_vec, i64 0, i64 ptrtoint (i64* @g_offset to i64))
316316
ret i8 %v
317317
}
318+
319+
@g_with_padding = constant { i32, [4 x i8] } { i32 0, [4 x i8] undef }
320+
321+
define i32 @load_padding() {
322+
; CHECK-LABEL: @load_padding(
323+
; CHECK-NEXT: ret i32 0
324+
;
325+
%v = load i32, i32* getelementptr (i32, i32* bitcast ({ i32, [4 x i8] }* @g_with_padding to i32*), i64 1)
326+
ret i32 %v
327+
}

0 commit comments

Comments
 (0)