• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -relocation-model=pic -mtriple=thumbv7-unknown-linux -o - %s | FileCheck %s
2
3@x = external global i32
4
5; CHECK: .globl	foo
6; CHECK-NEXT: .p2align	2
7define i32* @foo() {
8  ret i32* @x
9}
10
11; CHECK: .globl	bar
12; CHECK-NEXT: .p2align	1
13define i32* @bar() {
14  ret i32* zeroinitializer
15}
16
17@a = external global i32
18@b = external global i32
19@c = external global i32
20@d = external global i32
21
22; Create a Thumb-2 jump table, which should force alignment to 4 bytes.
23
24; CHECK: .globl	baz
25; CHECK-NEXT: .p2align	2
26; CHECK: tbb
27define i32 @baz() {
28  %1 = load i32, i32* @c, align 4
29  switch i32 %1, label %7 [
30    i32 1, label %2
31    i32 4, label %5
32    i32 9, label %5
33    i32 3, label %8
34  ]
35
36; <label>:2
37  %3 = load i32, i32* @a, align 4
38  %4 = tail call i32 bitcast (i32 (...)* @fn2 to i32 (i32 (...)*, i32, i32)*)(i32 (...)* bitcast (i32 ()* @baz to i32 (...)*), i32 0, i32 %3) #2
39  br label %8
40
41; <label>:5
42  %6 = load i32, i32* @d, align 4
43  store i32 %6, i32* @b, align 4
44  br label %8
45
46; <label>:7
47  br label %8
48
49; <label>:8
50  %e.0 = phi i32 [ 1, %7 ], [ 1, %2 ], [ 0, %0 ], [ 0, %5 ]
51  ret i32 %e.0
52}
53
54declare i32 @fn2(...)
55