[InstSimplify] Add load of undef aggregate test (NFC)
authorNikita Popov <nikita.ppv@gmail.com>
Sun, 21 Mar 2021 16:40:17 +0000 (17:40 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Sun, 21 Mar 2021 16:42:26 +0000 (17:42 +0100)
To make sure this doesn't crash the following commit.

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

index 4da8f0d..6f25b9f 100644 (file)
@@ -251,3 +251,13 @@ define i64 @test_array_of_zero_size_array() {
   %v = load i64, i64* bitcast ([4294967295 x [0 x i32]]* @g9 to i64*)
   ret i64 %v
 }
+
+@g10 = constant {i128} {i128 undef}
+
+define i32* @test_undef_aggregate() {
+; CHECK-LABEL: @test_undef_aggregate(
+; CHECK-NEXT:    ret i32* undef
+;
+  %v = load i32*, i32** bitcast ({i128}* @g10 to i32**)
+  ret i32* %v
+}