brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.4 KiB · 495ceb8 Raw
103 lines · plain
1@ RUN: not llvm-mc %s -triple thumbv7-linux-gnueabi -filetype=obj -o /dev/null 2>&1 | FileCheck %s2 3// Thumb2 unconditional branch has a range of +- 16 Megabytes. The4// conditional branch has a range of +- 1 Megabyte. We should give5// an error message if we evaluate the expression at assembly6// time and it is out of range.7 8        .syntax unified9        .thumb10        b.w end11        .space 0xfffffe12end:13        b.w end214        .space 0xfffffe15        .global end216end2:17 18// branch to arm function uses relocation19        b.w end320        .space 0x100000021        .global end322        .type end3, %function23        .arm24end3:   bx lr25        .thumb26 27// branch to thumb function is resolved at assembly time28// CHECK-NOT: error:29// CHECK: [[@LINE+2]]:[[#]]: error: Relocation out of range30// CHECK-LABEL: b.w end431        b.w end432        .space 0x100000033        .thumb_func34end4:35 36        beq.w end537        .space 0xffffc38end5:39 40// conditional branch to arm function uses relocation41        beq.w end642        .arm43        .type end6, %function44        .space 0x10000045end6:   bx lr46        .thumb47 48// conditional branch to thumb function resolved at assembly time49// CHECK-NOT: error:50// CHECK: [[@LINE+2]]:[[#]]: error: Relocation out of range51// CHECK-LABEL: beq.w end752        beq.w end753        .space 0x10000054end7:55 56start:57        .space 0xfffffc58        b.w start59 60        .arm61        .global start262        .type start2, %function63start2:64        .space 0x100000065        .thumb66// branch to arm function uses relocation67        b.w start268 69start3:70        .space 0x100000071// branch to thumb function resolved at assembly time72// CHECK-NOT: error:73// CHECK: [[@LINE+2]]:[[#]]: error: Relocation out of range74// CHECK-LABEL: b.w start375        b.w start376 77start4:78        .space 0xffffc79        b.w start480 81        .arm82        .global start583        .type start5, %function84start5:85        .space 0x10000086        .thumb87// conditional branch to arm function uses relocation88        beq.w start589 90start6:91        .space 0x10000092// branch to thumb function resolved at assembly time93// CHECK-NOT: error:94// CHECK: [[@LINE+2]]:[[#]]: error: Relocation out of range95// CHECK-LABEL: beq.w start696        beq.w start697 98start7:99// branch to thumb function resolved at assembly time100// CHECK: [[#@LINE+1]]:[[#]]: error: Relocation out of range101        b.w start8 - start7 + 0x1000000102start8:103