summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/SimplifyCFG/callbr-destinations.ll
blob: 18210e5e0b06034898cb28386ec4b8584c5c6052 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
; RUN: opt < %s -simplifycfg -disable-output
;
; Test that SimplifyCFG does not cause CallBr instructions to have duplicate
; destinations, which will cause the verifier to assert.

define void @fun0() {
entry:
  callbr void asm sideeffect "", "X"(i8* blockaddress(@fun0, %bb1))
          to label %bb2 [label %bb1]

bb1:                                              ; preds = %bb
  ret void

bb2:                                             ; preds = %bb
  ret void
}

define void @fun1() {
entry:
  callbr void asm sideeffect "", "X"(i8* blockaddress(@fun1, %bb1))
          to label %bb2 [label %bb1]

bb2:                                             ; preds = %bb
  ret void

bb1:                                              ; preds = %bb
  ret void
}
OpenPOWER on IntegriCloud