139 lines · plain
1@ This test has a partner (ltorg-darwin.s) that contains matching2@ tests for the .ltorg on darwin 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-unknown-linux-gnueabi %s | FileCheck %s8@RUN: llvm-mc -triple thumbv5-unknown-linux-gnueabi %s | FileCheck %s9@RUN: llvm-mc -triple thumbv7-unknown-linux-gnueabi %s | FileCheck %s10 11@ check that ltorg dumps the constant pool at the current location12.section a,"ax",%progbits13@ CHECK-LABEL: f2:14f2:15 ldr r0, =0x1000216@ CHECK: ldr r0, .Ltmp[[TMP0:[0-9+]]]17 adds r0, r0, #118 adds r0, r0, #119 b f320.ltorg21@ constant pool22@ CHECK: .p2align 223@ CHECK: .Ltmp[[TMP0]]24@ CHECK: .long 6553825 26@ CHECK-LABEL: f3:27f3:28 adds r0, r0, #129 adds r0, r0, #130 31@ check that ltorg clears the constant pool after dumping it32.section b,"ax",%progbits33@ CHECK-LABEL: f4:34f4:35 ldr r0, =0x1000336@ CHECK: ldr r0, .Ltmp[[TMP1:[0-9+]]]37 adds r0, r0, #138 adds r0, r0, #139 b f540.ltorg41@ constant pool42@ CHECK: .p2align 243@ CHECK: .Ltmp[[TMP1]]44@ CHECK: .long 6553945 46@ CHECK-LABEL: f5:47f5:48 adds r0, r0, #149 adds r0, r0, #150 ldr r0, =0x1000451@ CHECK: ldr r0, .Ltmp[[TMP2:[0-9+]]]52 adds r0, r0, #153 b f654.ltorg55@ constant pool56@ CHECK: .p2align 257@ CHECK: .Ltmp[[TMP2]]58@ CHECK: .long 6554059 60@ CHECK-LABEL: f6:61f6:62 adds r0, r0, #163 adds r0, r0, #164 65@ check that ltorg does not issue an error if there is no constant pool66.section c,"ax",%progbits67@ CHECK-LABEL: f7:68f7:69 adds r0, r0, #170 b f871 .ltorg72f8:73 adds r0, r0, #174 75@ check that ltorg works for labels76.section d,"ax",%progbits77@ CHECK-LABEL: f9:78f9:79 adds r0, r0, #180 adds r0, r0, #181 ldr r0, =bar82@ CHECK: ldr r0, .Ltmp[[TMP3:[0-9+]]]83 adds r0, r0, #184 adds r0, r0, #185 adds r0, r0, #186 b f1087.ltorg88@ constant pool89@ CHECK: .p2align 290@ CHECK: .Ltmp[[TMP3]]91@ CHECK: .long bar92 93@ CHECK-LABEL: f10:94f10:95 adds r0, r0, #196 adds r0, r0, #197 98@ check that use of ltorg does not prevent dumping non-empty constant pools at end of section99.section e,"ax",%progbits100@ CHECK-LABEL: f11:101f11:102 adds r0, r0, #1103 adds r0, r0, #1104 ldr r0, =0x10005105@ CHECK: ldr r0, .Ltmp[[TMP4:[0-9+]]]106 b f12107 .ltorg108@ constant pool109@ CHECK: .p2align 2110@ CHECK: .Ltmp[[TMP4]]111@ CHECK: .long 65541112@ CHECK-LABEL: f12:113f12:114 adds r0, r0, #1115 ldr r0, =0x10006116@ CHECK: ldr r0, .Ltmp[[TMP5:[0-9+]]]117 118.section f,"ax",%progbits119@ CHECK-LABEL: f13120f13:121 adds r0, r0, #1122 adds r0, r0, #1123 124@ should not have a constant pool at end of section with empty constant pools125@ CHECK-NOT: .section a,"ax",%progbits126@ CHECK-NOT: .section b,"ax",%progbits127@ CHECK-NOT: .section c,"ax",%progbits128@ CHECK-NOT: .section d,"ax",%progbits129 130@ should have a non-empty constant pool at end of this section131@ CHECK: .section e,"ax",%progbits132@ constant pool133@ CHECK: .p2align 2134@ CHECK: .Ltmp[[TMP5]]135@ CHECK: .long 65542136 137@ should not have a constant pool at end of section with empty constant pools138@ CHECK-NOT: .section f,"ax",%progbits139