1 ; RUN: llc -mtriple=thumbv8m.base-eabi -mattr=+execute-only %s -o - | FileCheck --check-prefix=CHECK --check-prefix=CHECK-T2BASE %s
2 ; RUN: llc -mtriple=thumbv8m.base-eabi -mcpu=cortex-m23 -mattr=+execute-only %s -o - | FileCheck --check-prefix=CHECK --check-prefix=CHECK-T2BASE %s
3 ; RUN: llc -mtriple=thumbv7m-eabi -mattr=+execute-only %s -o - | FileCheck --check-prefix=CHECK --check-prefix=CHECK-T2 %s
4 ; RUN: llc -mtriple=thumbv8m.main-eabi -mattr=+execute-only %s -o - | FileCheck --check-prefix=CHECK --check-prefix=CHECK-T2 %s
6 ; CHECK-NOT: {{^ *}}.text{{$}}
7 ; CHECK: .section .text,"axy",%progbits,unique,0
11 define i32 @global() minsize {
12 ; CHECK-LABEL: global:
13 ; CHECK: movw [[GLOBDEST:r[0-9]+]], :lower16:var
14 ; CHECK: movt [[GLOBDEST]], :upper16:var
16 %val = load i32, i32* @var
20 define i32 @jump_table(i32 %c, i32 %a, i32 %b) #0 {
21 ; CHECK-LABEL: jump_table:
22 ; CHECK-T2: adr.w [[REG_JT:r[0-9]+]], .LJTI1_0
23 ; CHECK-T2: add.w [[REG_ENTRY:r[0-9]+]], [[REG_JT]], {{r[0-9]+}}, lsl #2
24 ; CHECK-T2: mov pc, [[REG_ENTRY]]
26 ; CHECK-T2BASE: lsls [[REG_OFFSET:r[0-9]+]], {{r[0-9]+}}, #2
27 ; CHECK-T2BASE: adr [[REG_JT:r[0-9]+]], .LJTI1_0
28 ; CHECK-T2BASE: adds [[REG_ENTRY:r[0-9]+]], [[REG_JT]], [[REG_OFFSET]]
29 ; CHECK-T2BASE: mov pc, [[REG_ENTRY]]
31 ; CHECK-LABEL: .LJTI1_0:
40 switch i32 %c, label %return [
49 sw.bb: ; preds = %entry
50 %add = add nsw i32 %a, 6
53 sw.bb1: ; preds = %entry
54 %add2 = add nsw i32 %a, 4
57 sw.bb3: ; preds = %entry
58 %sub = add nsw i32 %a, -3
61 sw.bb4: ; preds = %entry
62 %add5 = add nsw i32 %b, 5
65 sw.bb6: ; preds = %entry
66 %add7 = add nsw i32 %a, 1
69 sw.bb8: ; preds = %entry
70 %add9 = add nsw i32 %a, 2
73 return: ; preds = %entry, %sw.bb8, %sw.bb6, %sw.bb4, %sw.bb3, %sw.bb1, %sw.bb
74 %retval.0 = phi i32 [ %add9, %sw.bb8 ], [ %add7, %sw.bb6 ], [ %add5, %sw.bb4 ], [ %sub, %sw.bb3 ], [ %add2, %sw.bb1 ], [ %add, %sw.bb ], [ 0, %entry ]
78 @.str = private unnamed_addr constant [4 x i8] c"FOO\00", align 1
80 define hidden i8* @string_literal() {
82 ; CHECK-LABEL: string_literal:
85 ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0)