1@ Test case for PR30352 2@ Check that ldr.w is: 3@ accepted and ignored for ARM 4@ accepted and propagated for Thumb2 5@ rejected as needing Thumb2 for Thumb 6 7@RUN: llvm-mc -triple armv5-unknown-linux-gnueabi %s | FileCheck --check-prefix=CHECK-ARM --check-prefix=CHECK %s 8@RUN: llvm-mc -triple armv7-base-apple-darwin %s | FileCheck --check-prefix=CHECK-DARWIN-ARM --check-prefix=CHECK-DARWIN %s 9@RUN: llvm-mc -triple thumbv7-unknown-linux-gnueabi %s | FileCheck --check-prefix=CHECK-THUMB2 --check-prefix=CHECK %s 10@RUN: llvm-mc -triple thumbv7-base-apple-darwin %s | FileCheck --check-prefix=CHECK-DARWIN-THUMB2 --check-prefix=CHECK-DARWIN %s 11@RUN: not llvm-mc -triple thumbv6-unknown-linux-gnueabi %s 2>&1 | FileCheck --check-prefix=CHECK-THUMB %s 12@RUN: not llvm-mc -triple thumbv6-base-apple-darwin %s 2>&1 | FileCheck --check-prefix=CHECK-THUMB %s 13@ CHECK-LABEL: f1: 14f1: 15 ldr r0, =0x10002 16@ CHECK-ARM: ldr r0, .Ltmp[[TMP0:[0-9]+]] 17@ CHECK-DARWIN-ARM: ldr r0, Ltmp0 18@ CHECK-THUMB2: ldr r0, .Ltmp[[TMP0:[0-9]+]] 19@ CHECK-DARWIN-THUMB2: ldr r0, Ltmp0 20 21 ldr.w r0, =0x10002 22@ CHECK-ARM: ldr r0, .Ltmp[[TMP0]] 23@ CHECK-DARWIN-ARM: ldr r0, Ltmp0 24@ CHECK-THUMB2: ldr.w r0, .Ltmp[[TMP0:[0-9]+]] 25@ CHECK-DARWIN-THUMB2: ldr.w r0, Ltmp0 26@ CHECK-THUMB: error: instruction requires: thumb2 27@ CHECK-THUMB-NEXT: ldr.w r0, =0x10002 28 29@ CHECK-LABEL: f2: 30f2: 31 ldr r0, =foo 32@ CHECK-ARM: ldr r0, .Ltmp[[TMP1:[0-9]+]] 33@ CHECK-DARWIN-ARM: ldr r0, Ltmp1 34@ CHECK-THUMB2: ldr r0, .Ltmp[[TMP1:[0-9]+]] 35@ CHECK-DARWIN-THUMB2: ldr r0, Ltmp1 36 37 ldr.w r0, =foo 38@ CHECK-ARM: ldr r0, .Ltmp[[TMP2:[0-9]+]] 39@ CHECK-DARWIN-ARM: ldr r0, Ltmp2 40@ CHECK-THUMB2: ldr.w r0, .Ltmp[[TMP2:[0-9]+]] 41@ CHECK-DARWIN-THUMB2: ldr.w r0, Ltmp2 42@ CHECK-THUMB: error: instruction requires: thumb2 43@ CHECK-THUMB-NEXT: ldr.w r0, =foo 44 45@ CHECK-LABEL: f3: 46f3: 47 ldr.w r1, =0x1 48@ CHECK-ARM: mov r1, #1 49@ CHECK-DARWIN-ARM: mov r1, #1 50@ CHECK-THUMB2: mov.w r1, #1 51@ CHECK-DARWIN-THUMB2: mov.w r1, #1 52@ CHECK-THUMB: error: instruction requires: thumb2 53@ CHECK-THUMB-NEXT: ldr.w r1, =0x1 54 55@ CHECK: .Ltmp0: 56@ CHECK-NEXT: .long 65538 57@ CHECK: .Ltmp1: 58@ CHECK-NEXT: .long foo 59@ CHECK: .Ltmp2: 60@ CHECK-NEXT: .long foo 61 62@ CHECK-DARWIN: Ltmp0: 63@ CHECK-DARWIN-NEXT: .long 65538 64@ CHECK-DARWIN: Ltmp1: 65@ CHECK-DARWIN-NEXT: .long foo 66@ CHECK-DARWIN: Ltmp2: 67@ CHECK-DARWIN-NEXT: .long foo 68