xref: /llvm-project/llvm/test/CodeGen/X86/asm-label.ll (revision 2b63077cfa13095b3e64f79fe825cc85ca9da7be)
1; RUN: llc -mtriple=x86_64-apple-darwin10 -O0 < %s | FileCheck %s
2
3; test that we print a label that we use. We had a bug where
4; we would print the jump, but not the label because it was considered
5; a fall through.
6
7; CHECK:        jmp     LBB0_9
8; CHECK: LBB0_9:                                 ## %cleanup
9
10; RUN: llc -filetype=obj -mtriple=x86_64 -O0 -save-temp-labels < %s | llvm-objdump -d - | FileCheck %s --check-prefix=SAVETEMP
11
12; SAVETEMP:         jne {{.*}} <.LBB0_1>
13; SAVETEMP-LABEL: <.LBB0_1>:
14
15define void @foo(i1 %arg, i32 %arg2)  {
16entry:
17  br i1 %arg, label %land.lhs.true, label %if.end11
18
19land.lhs.true:                                    ; preds = %entry
20  br i1 %arg, label %if.then, label %if.end11
21
22if.then:                                          ; preds = %land.lhs.true
23  br i1 %arg, label %if.then9, label %if.end
24
25if.then9:                                         ; preds = %if.then
26  br label %cleanup
27
28if.end:                                           ; preds = %if.then
29  br label %cleanup
30
31cleanup:                                          ; preds = %if.end, %if.then9
32  switch i32 %arg2, label %default [
33    i32 0, label %cleanup.cont
34    i32 1, label %if.end11
35  ]
36
37cleanup.cont:                                     ; preds = %cleanup
38  br label %if.end11
39
40if.end11:                                         ; preds = %cleanup.cont, %cleanup, %land.lhs.true, %entry
41  ret void
42
43default:                                          ; preds = %cleanup
44  br label %if.end11
45}
46