Renato Golin | 1235060 | 2015-03-17 11:55:28 +0000 | [diff] [blame] | 1 | @ RUN: not llvm-mc -triple=armv6 -show-encoding < %s > %t1 2> %t2 |
| 2 | @ RUN: FileCheck --check-prefix=CHECK-V6 %s < %t1 |
| 3 | @ RUN: FileCheck --check-prefix=CHECK-ERROR-V6 %s < %t2 |
| 4 | @ RUN: llvm-mc -triple=armv6k -show-encoding < %s \ |
| 5 | @ RUN: | FileCheck --check-prefix=CHECK-ARM %s |
| 6 | @ RUN: llvm-mc -triple=armv6t2 -show-encoding < %s \ |
| 7 | @ RUN: | FileCheck --check-prefix=CHECK-ARM %s |
| 8 | @ RUN: llvm-mc -triple=thumb -mcpu=arm1156t2-s -show-encoding < %s \ |
| 9 | @ RUN: | FileCheck --check-prefix=CHECK-THUMB %s |
| 10 | @ RUN: llvm-mc -triple=armv6m -show-encoding < %s \ |
| 11 | @ RUN: | FileCheck --check-prefix=CHECK-V6M %s |
| 12 | |
| 13 | .syntax unified |
| 14 | |
| 15 | @------------------------------------------------------------------------------ |
| 16 | @ YIELD/WFE/WFI/SEV - are not supported pre v6K |
| 17 | @------------------------------------------------------------------------------ |
| 18 | nop |
| 19 | yield |
| 20 | wfe |
| 21 | wfi |
| 22 | sev |
| 23 | |
| 24 | |
| 25 | @------------------------------------------------------------------------------ |
| 26 | @ v6 using ARM encoding |
| 27 | @------------------------------------------------------------------------------ |
| 28 | @ CHECK-V6: mov r0, r0 @ encoding: [0x00,0x00,0xa0,0xe1] |
| 29 | @ CHECK-ERROR-V6: error: instruction requires: armv6k |
| 30 | @ CHECK-ERROR-V6: yield |
| 31 | @ CHECK-ERROR-V6: ^ |
| 32 | @ CHECK-ERROR-V6: error: instruction requires: armv6k |
| 33 | @ CHECK-ERROR-V6: wfe |
| 34 | @ CHECK-ERROR-V6: ^ |
| 35 | @ CHECK-ERROR-V6: error: instruction requires: armv6k |
| 36 | @ CHECK-ERROR-V6: wfi |
| 37 | @ CHECK-ERROR-V6: error: instruction requires: armv6k |
| 38 | @ CHECK-ERROR-V6: sev |
| 39 | @ CHECK-ERROR-V6: ^ |
| 40 | |
| 41 | @------------------------------------------------------------------------------ |
| 42 | @ v6K using ARM encoding |
| 43 | @------------------------------------------------------------------------------ |
| 44 | @------------------------------------------------------------------------------ |
| 45 | @ v6T2 using ARM encoding (arm triple) |
| 46 | @------------------------------------------------------------------------------ |
| 47 | @ CHECK-ARM: nop @ encoding: [0x00,0xf0,0x20,0xe3] |
| 48 | @ CHECK-ARM: yield @ encoding: [0x01,0xf0,0x20,0xe3] |
| 49 | @ CHECK-ARM: wfe @ encoding: [0x02,0xf0,0x20,0xe3] |
| 50 | @ CHECK-ARM: wfi @ encoding: [0x03,0xf0,0x20,0xe3] |
| 51 | @ CHECK-ARM: sev @ encoding: [0x04,0xf0,0x20,0xe3] |
| 52 | |
| 53 | @------------------------------------------------------------------------------ |
| 54 | @ v6T2 using THUMB encoding (thumb triple) |
| 55 | @------------------------------------------------------------------------------ |
| 56 | @ CHECK-THUMB: nop @ encoding: [0x00,0xbf] |
| 57 | @ CHECK-THUMB: yield @ encoding: [0x10,0xbf] |
| 58 | @ CHECK-THUMB: wfe @ encoding: [0x20,0xbf] |
| 59 | @ CHECK-THUMB: wfi @ encoding: [0x30,0xbf] |
| 60 | @ CHECK-THUMB: sev @ encoding: [0x40,0xbf] |
| 61 | |
| 62 | @------------------------------------------------------------------------------ |
| 63 | @ v6M using THUMB encoding |
| 64 | @------------------------------------------------------------------------------ |
| 65 | @ CHECK-V6M: nop @ encoding: [0x00,0xbf] |
| 66 | @ CHECK-V6M: yield @ encoding: [0x10,0xbf] |
| 67 | @ CHECK-V6M: wfe @ encoding: [0x20,0xbf] |
| 68 | @ CHECK-V6M: wfi @ encoding: [0x30,0xbf] |
| 69 | @ CHECK-V6M: sev @ encoding: [0x40,0xbf] |