47 lines · plain
1; RUN: llc -mtriple=hexagon < %s2; REQUIRES: asserts3;4; The tail calls to foo and bar are branches with functions as operands,5; instead of basic blocks. Make sure we don't crash on such instructions.6 7target datalayout = "e-m:e-p:32:32:32-i64:64:64-i32:32:32-i16:16:16-i1:8:8-f64:64:64-f32:32:32-v64:64:64-v32:32:32-a:0-n16:32"8target triple = "hexagon"9 10%struct.t0 = type { i8, [2 x i8] }11%struct.t1 = type { i8, i8, [1900 x i8], %struct.t0 }12 13@var = internal global [3 x %struct.t1] zeroinitializer, align 814declare void @foo() #215declare void @bar(i32, i32) #216 17; Function Attrs: nounwind18define void @fred(i8 signext %a, i8 signext %b) #1 {19entry:20 %i = sext i8 %a to i3221 %t = getelementptr inbounds [3 x %struct.t1], ptr @var, i32 0, i32 %i, i32 3, i32 022 %0 = load i8, ptr %t, align 823 switch i8 %0, label %if.end14 [24 i8 1, label %if.then25 i8 0, label %do.body26 ]27 28if.then: ; preds = %entry29 %j = sext i8 %b to i3230 %u = getelementptr inbounds [3 x %struct.t1], ptr @var, i32 0, i32 %i, i32 3, i32 1, i32 %j31 store i8 1, ptr %u, align 132 tail call void @foo() #033 br label %if.end1434 35do.body: ; preds = %entry36 %conv11 = sext i8 %b to i3237 tail call void @bar(i32 %i, i32 %conv11) #038 br label %if.end1439 40if.end14: ; preds = %entry, %do.body, %if.then41 ret void42}43 44attributes #0 = { nounwind }45attributes #1 = { nounwind "disable-tail-calls"="false" }46attributes #2 = { "disable-tail-calls"="false" }47