select-crash-noverify.ll 513 B

12345678910111213141516171819
  1. ; RUN: opt < %s -disable-verify -instcombine -S | opt -S | FileCheck %s
  2. ; Formerly crashed, PR8490.
  3. ; CHECK-LABEL: @test3(
  4. define i32 @test3(i1 %bool, i32 %a) {
  5. entry:
  6. %cond = or i1 %bool, true
  7. br i1 %cond, label %return, label %xpto
  8. ; technically reachable, but this malformed IR may appear as a result of constant propagation
  9. xpto:
  10. %select = select i1 %bool, i32 %a, i32 %select
  11. %select2 = select i1 %bool, i32 %select2, i32 %a
  12. %sum = add i32 %select, %select2
  13. ret i32 %sum
  14. return:
  15. ret i32 7
  16. }