1; RUN: llc -mtriple=arm64-apple-ios < %s | FileCheck %s
2; RUN: llc -mtriple=arm64-linux-gnu < %s | FileCheck %s --check-prefix=CHECK-LINUX
3; <rdar://11417675>
4
5define void @sum(i32 %a, i32* %to, i32 %c) {
6entry:
7  switch i32 %a, label %exit [
8    i32 1, label %bb1
9    i32 2, label %exit.sink.split
10    i32 3, label %bb3
11    i32 4, label %bb4
12  ]
13bb1:
14  %b = add i32 %c, 1
15  br label %exit.sink.split
16bb3:
17  br label %exit.sink.split
18bb4:
19  br label %exit.sink.split
20exit.sink.split:
21  %.sink = phi i32 [ 5, %bb4 ], [ %b, %bb1 ], [ 3, %bb3 ], [ %a, %entry ]
22  store i32 %.sink, i32* %to
23  br label %exit
24exit:
25  ret void
26}
27
28; CHECK-LABEL: sum:
29; CHECK: adrp    {{x[0-9]+}}, LJTI0_0@PAGE
30; CHECK:  add    {{x[0-9]+}}, {{x[0-9]+}}, LJTI0_0@PAGEOFF
31
32; CHECK-LINUX-LABEL: sum:
33; CHECK-LINUX: adrp    {{x[0-9]+}}, .LJTI0_0
34; CHECK-LINUX:  add    {{x[0-9]+}}, {{x[0-9]+}}, :lo12:.LJTI0_0
35