152 lines · plain
1@ This test has a partner (ltorg.s) that contains matching2@ tests for the .ltorg on linux targets. We need separate files3@ because the syntax for switching sections and temporary labels differs4@ between darwin and linux. Any tests added here should have a matching5@ test added there.6 7@RUN: llvm-mc -triple armv7-apple-darwin %s | FileCheck %s8@RUN: llvm-mc -triple thumbv5-apple-darwin %s | FileCheck %s9@RUN: llvm-mc -triple thumbv7-apple-darwin %s | FileCheck %s10 11@ check that ltorg dumps the constant pool at the current location12.section __TEXT,a,regular,pure_instructions13@ CHECK-LABEL: f2:14f2:15 ldr r0, =0x1000216@ CHECK: ldr r0, Ltmp017 adds r0, r0, #118 adds r0, r0, #119 b f320.ltorg21@ constant pool22@ CHECK: .data_region23@ CHECK: .p2align 224@ CHECK-LABEL: Ltmp0:25@ CHECK: .long 6553826@ CHECK: .end_data_region27 28@ CHECK-LABEL: f3:29f3:30 adds r0, r0, #131 adds r0, r0, #132 33@ check that ltorg clears the constant pool after dumping it34.section __TEXT,b,regular,pure_instructions35@ CHECK-LABEL: f4:36f4:37 ldr r0, =0x1000338@ CHECK: ldr r0, Ltmp139 adds r0, r0, #140 adds r0, r0, #141 b f542.ltorg43@ constant pool44@ CHECK: .data_region45@ CHECK: .p2align 246@ CHECK-LABEL: Ltmp1:47@ CHECK: .long 6553948@ CHECK: .end_data_region49 50@ CHECK-LABEL: f5:51f5:52 adds r0, r0, #153 adds r0, r0, #154 ldr r0, =0x1000455@ CHECK: ldr r0, Ltmp256 adds r0, r0, #157 b f658.ltorg59@ constant pool60@ CHECK: .data_region61@ CHECK: .p2align 262@ CHECK-LABEL: Ltmp2:63@ CHECK: .long 6554064@ CHECK: .end_data_region65 66@ CHECK-LABEL: f6:67f6:68 adds r0, r0, #169 adds r0, r0, #170 71@ check that ltorg does not issue an error if there is no constant pool72.section __TEXT,c,regular,pure_instructions73@ CHECK-LABEL: f7:74f7:75 adds r0, r0, #176 b f877 .ltorg78f8:79 adds r0, r0, #180 81@ check that ltorg works for labels82.section __TEXT,d,regular,pure_instructions83@ CHECK-LABEL: f9:84f9:85 adds r0, r0, #186 adds r0, r0, #187 ldr r0, =bar88@ CHECK: ldr r0, Ltmp389 adds r0, r0, #190 adds r0, r0, #191 adds r0, r0, #192 b f1093.ltorg94@ constant pool95@ CHECK: .data_region96@ CHECK: .p2align 297@ CHECK-LABEL: Ltmp3:98@ CHECK: .long bar99@ CHECK: .end_data_region100 101@ CHECK-LABEL: f10:102f10:103 adds r0, r0, #1104 adds r0, r0, #1105 106@ check that use of ltorg does not prevent dumping non-empty constant pools at end of section107.section __TEXT,e,regular,pure_instructions108@ CHECK-LABEL: f11:109f11:110 adds r0, r0, #1111 adds r0, r0, #1112 ldr r0, =0x10005113@ CHECK: ldr r0, Ltmp4114 b f12115 .ltorg116@ constant pool117@ CHECK: .data_region118@ CHECK: .p2align 2119@ CHECK-LABEL: Ltmp4:120@ CHECK: .long 65541121@ CHECK: .end_data_region122 123@ CHECK-LABEL: f12:124f12:125 adds r0, r0, #1126 ldr r0, =0x10006127@ CHECK: ldr r0, Ltmp5128 129.section __TEXT,f,regular,pure_instructions130@ CHECK-LABEL: f13131f13:132 adds r0, r0, #1133 adds r0, r0, #1134 135@ should not have a constant pool at end of section with empty constant pools136@ CHECK-NOT: .section __TEXT,a,regular,pure_instructions137@ CHECK-NOT: .section __TEXT,b,regular,pure_instructions138@ CHECK-NOT: .section __TEXT,c,regular,pure_instructions139@ CHECK-NOT: .section __TEXT,d,regular,pure_instructions140 141@ should have a non-empty constant pool at end of this section142@ CHECK: .section __TEXT,e,regular,pure_instructions143@ constant pool144@ CHECK: .data_region145@ CHECK: .p2align 2146@ CHECK-LABEL: Ltmp5:147@ CHECK: .long 65542148@ CHECK: .end_data_region149 150@ should not have a constant pool at end of section with empty constant pools151@ CHECK-NOT: .section __TEXT,f,regular,pure_instructions152