1 ; RUN: opt -S -codegenprepare -mtriple=arm64-apple-ios7.0 %s | FileCheck %s
5 define %foo @test_merge(i32 %in) {
6 ; CHECK-LABEL: @test_merge
8 ; CodeGenPrepare was requesting the EVT for { i8 } to determine
9 ; whether the insertvalue user of the trunc was legal. This
12 ; CHECK: insertvalue %foo undef, i8 %byte, 0
13 %lobit = lshr i32 %in, 31
14 %byte = trunc i32 %lobit to i8
15 %struct = insertvalue %foo undef, i8 %byte, 0
19 define i64* @test_merge_PR21548(i32 %a, i64* %p1, i64* %p2, i64* %p3) {
20 ; CHECK-LABEL: @test_merge_PR21548
22 %Tr = trunc i32 %as to i1
23 br i1 %Tr, label %BB2, label %BB3
27 ; CodeGenPrepare was requesting the EVT for i8* to determine
28 ; whether the select user of the trunc was legal. This asserted.
30 ; CHECK: select i1 {{%.*}}, i64* %p1, i64* %p2
31 %p = select i1 %Tr, i64* %p1, i64* %p2