1 ; Trivial smoke test of basic block reordering. Different random seeds should 2 ; generate different basic block layout. 3 ; REQUIRES: allow_dump 4 5 ; RUN: %p2i -i %s --filetype=asm --args -O2 -sz-seed=1 \ 6 ; RUN: -reorder-basic-blocks -threads=0 \ 7 ; RUN: | FileCheck %s --check-prefix=SEED1 8 ; RUN: %p2i -i %s --filetype=asm --args -O2 -sz-seed=2 \ 9 ; RUN: -reorder-basic-blocks -threads=0 \ 10 ; RUN: | FileCheck %s --check-prefix=SEED2 11 12 define internal void @basic_block_reordering(i32 %foo, i32 %bar) { 13 entry: 14 %r1 = icmp eq i32 %foo, %bar 15 br i1 %r1, label %BB1, label %BB2 16 BB1: 17 %r2 = icmp sgt i32 %foo, %bar 18 br i1 %r2, label %BB3, label %BB4 19 BB2: 20 %r3 = icmp slt i32 %foo, %bar 21 br i1 %r3, label %BB3, label %BB4 22 BB3: 23 ret void 24 BB4: 25 ret void 26 27 28 ; SEED1-LABEL: basic_block_reordering: 29 ; SEED1: .Lbasic_block_reordering$entry: 30 ; SEED1: .Lbasic_block_reordering$BB1: 31 ; SEED1: .Lbasic_block_reordering$BB2: 32 ; SEED1: .Lbasic_block_reordering$BB4: 33 ; SEED1: .Lbasic_block_reordering$BB3: 34 35 ; SEED2-LABEL: basic_block_reordering: 36 ; SEED2: .Lbasic_block_reordering$entry: 37 ; SEED2: .Lbasic_block_reordering$BB2: 38 ; SEED2: .Lbasic_block_reordering$BB1: 39 ; SEED2: .Lbasic_block_reordering$BB4: 40 ; SEED2: .Lbasic_block_reordering$BB3 41 } 42