[llvm] r286417 - [AVR] Add all of the machine code test suite

Dylan McKay via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 9 15:46:27 PST 2016


Author: dylanmckay
Date: Wed Nov  9 17:46:25 2016
New Revision: 286417

URL: http://llvm.org/viewvc/llvm-project?rev=286417&view=rev
Log:
[AVR] Add all of the machine code test suite

Summary: This adds all of the AVR machine code tests.

Reviewers: arsenm, kparzysz

Subscribers: wdng, japaric

Differential Revision: https://reviews.llvm.org/D26387

Added:
    llvm/trunk/test/MC/AVR/
    llvm/trunk/test/MC/AVR/inst-adc.s
    llvm/trunk/test/MC/AVR/inst-add.s
    llvm/trunk/test/MC/AVR/inst-adiw.s
    llvm/trunk/test/MC/AVR/inst-and.s
    llvm/trunk/test/MC/AVR/inst-andi.s
    llvm/trunk/test/MC/AVR/inst-asr.s
    llvm/trunk/test/MC/AVR/inst-bld.s
    llvm/trunk/test/MC/AVR/inst-brbc.s
    llvm/trunk/test/MC/AVR/inst-brbs.s
    llvm/trunk/test/MC/AVR/inst-break.s
    llvm/trunk/test/MC/AVR/inst-bst.s
    llvm/trunk/test/MC/AVR/inst-call.s
    llvm/trunk/test/MC/AVR/inst-cbi.s
    llvm/trunk/test/MC/AVR/inst-cbr.s
    llvm/trunk/test/MC/AVR/inst-clr.s
    llvm/trunk/test/MC/AVR/inst-com.s
    llvm/trunk/test/MC/AVR/inst-cp.s
    llvm/trunk/test/MC/AVR/inst-cpc.s
    llvm/trunk/test/MC/AVR/inst-cpi.s
    llvm/trunk/test/MC/AVR/inst-cpse.s
    llvm/trunk/test/MC/AVR/inst-dec.s
    llvm/trunk/test/MC/AVR/inst-des.s
    llvm/trunk/test/MC/AVR/inst-eicall.s
    llvm/trunk/test/MC/AVR/inst-eijmp.s
    llvm/trunk/test/MC/AVR/inst-elpm.s
    llvm/trunk/test/MC/AVR/inst-eor.s
    llvm/trunk/test/MC/AVR/inst-family-cond-branch.s
    llvm/trunk/test/MC/AVR/inst-family-set-clr-flag.s
    llvm/trunk/test/MC/AVR/inst-fmul.s
    llvm/trunk/test/MC/AVR/inst-fmuls.s
    llvm/trunk/test/MC/AVR/inst-fmulsu.s
    llvm/trunk/test/MC/AVR/inst-icall.s
    llvm/trunk/test/MC/AVR/inst-ijmp.s
    llvm/trunk/test/MC/AVR/inst-in.s
    llvm/trunk/test/MC/AVR/inst-inc.s
    llvm/trunk/test/MC/AVR/inst-jmp.s
    llvm/trunk/test/MC/AVR/inst-lac.s
    llvm/trunk/test/MC/AVR/inst-las.s
    llvm/trunk/test/MC/AVR/inst-lat.s
    llvm/trunk/test/MC/AVR/inst-ld.s
    llvm/trunk/test/MC/AVR/inst-ldd.s
    llvm/trunk/test/MC/AVR/inst-ldi.s
    llvm/trunk/test/MC/AVR/inst-lds.s
    llvm/trunk/test/MC/AVR/inst-lpm.s
    llvm/trunk/test/MC/AVR/inst-lsl.s
    llvm/trunk/test/MC/AVR/inst-lsr.s
    llvm/trunk/test/MC/AVR/inst-mov.s
    llvm/trunk/test/MC/AVR/inst-movw.s
    llvm/trunk/test/MC/AVR/inst-mul.s
    llvm/trunk/test/MC/AVR/inst-muls.s
    llvm/trunk/test/MC/AVR/inst-mulsu.s
    llvm/trunk/test/MC/AVR/inst-neg.s
    llvm/trunk/test/MC/AVR/inst-nop.s
    llvm/trunk/test/MC/AVR/inst-or.s
    llvm/trunk/test/MC/AVR/inst-ori.s
    llvm/trunk/test/MC/AVR/inst-out.s
    llvm/trunk/test/MC/AVR/inst-pop.s
    llvm/trunk/test/MC/AVR/inst-push.s
    llvm/trunk/test/MC/AVR/inst-rcall.s
    llvm/trunk/test/MC/AVR/inst-ret.s
    llvm/trunk/test/MC/AVR/inst-reti.s
    llvm/trunk/test/MC/AVR/inst-rjmp.s
    llvm/trunk/test/MC/AVR/inst-rol.s
    llvm/trunk/test/MC/AVR/inst-ror.s
    llvm/trunk/test/MC/AVR/inst-sbc.s
    llvm/trunk/test/MC/AVR/inst-sbci.s
    llvm/trunk/test/MC/AVR/inst-sbi.s
    llvm/trunk/test/MC/AVR/inst-sbic.s
    llvm/trunk/test/MC/AVR/inst-sbis.s
    llvm/trunk/test/MC/AVR/inst-sbiw.s
    llvm/trunk/test/MC/AVR/inst-sbr.s
    llvm/trunk/test/MC/AVR/inst-sbrc.s
    llvm/trunk/test/MC/AVR/inst-sbrs.s
    llvm/trunk/test/MC/AVR/inst-ser.s
    llvm/trunk/test/MC/AVR/inst-sleep.s
    llvm/trunk/test/MC/AVR/inst-spm.s
    llvm/trunk/test/MC/AVR/inst-st.s
    llvm/trunk/test/MC/AVR/inst-std.s
    llvm/trunk/test/MC/AVR/inst-sts.s
    llvm/trunk/test/MC/AVR/inst-sub.s
    llvm/trunk/test/MC/AVR/inst-subi.s
    llvm/trunk/test/MC/AVR/inst-swap.s
    llvm/trunk/test/MC/AVR/inst-tst.s
    llvm/trunk/test/MC/AVR/inst-wdr.s
    llvm/trunk/test/MC/AVR/inst-xch.s
    llvm/trunk/test/MC/AVR/lit.local.cfg
    llvm/trunk/test/MC/AVR/modifiers.s
    llvm/trunk/test/MC/AVR/out-of-range-fixups/
    llvm/trunk/test/MC/AVR/out-of-range-fixups/adiw-fail.s
    llvm/trunk/test/MC/AVR/out-of-range-fixups/adiw-pass.s
    llvm/trunk/test/MC/AVR/out-of-range-fixups/brbs-pass.s
    llvm/trunk/test/MC/AVR/out-of-range-fixups/call-pass.s
    llvm/trunk/test/MC/AVR/out-of-range-fixups/in-fail.s
    llvm/trunk/test/MC/AVR/out-of-range-fixups/in-pass.s
    llvm/trunk/test/MC/AVR/out-of-range-fixups/lds-fail.s
    llvm/trunk/test/MC/AVR/out-of-range-fixups/lds-pass.s
    llvm/trunk/test/MC/AVR/out-of-range-fixups/rjmp-pass.s
    llvm/trunk/test/MC/AVR/out-of-range-fixups/sbi-fail.s
    llvm/trunk/test/MC/AVR/out-of-range-fixups/sbi-pass.s
    llvm/trunk/test/MC/AVR/relocations.s
    llvm/trunk/test/MC/AVR/symbol_relocation.s
    llvm/trunk/test/MC/AVR/syntax-reg-int-literal.s
    llvm/trunk/test/MC/AVR/syntax-reg-pair.s

Added: llvm/trunk/test/MC/AVR/inst-adc.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-adc.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-adc.s (added)
+++ llvm/trunk/test/MC/AVR/inst-adc.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,14 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  adc r0,  r15
+  adc r15, r0
+  adc r16, r31
+  adc r31, r16
+
+; CHECK: adc r0,  r15               ; encoding: [0x0f,0x1c]
+; CHECK: adc r15, r0                ; encoding: [0xf0,0x1c]
+; CHECK: adc r16, r31               ; encoding: [0x0f,0x1f]
+; CHECK: adc r31, r16               ; encoding: [0xf0,0x1f]

Added: llvm/trunk/test/MC/AVR/inst-add.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-add.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-add.s (added)
+++ llvm/trunk/test/MC/AVR/inst-add.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,14 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  add r0,  r15
+  add r15, r0
+  add r16, r31
+  add r31, r16
+
+; CHECK: add r0,  r15               ; encoding: [0x0f,0x0c]
+; CHECK: add r15, r0                ; encoding: [0xf0,0x0c]
+; CHECK: add r16, r31               ; encoding: [0x0f,0x0f]
+; CHECK: add r31, r16               ; encoding: [0xf0,0x0f]

Added: llvm/trunk/test/MC/AVR/inst-adiw.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-adiw.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-adiw.s (added)
+++ llvm/trunk/test/MC/AVR/inst-adiw.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,27 @@
+; RUN: llvm-mc -triple avr -mattr=addsubiw -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  adiw r26,  12
+  adiw r26,  63
+
+  adiw r28,  17
+  adiw r28,  0
+
+  adiw r30,  63
+  adiw r30,  3
+
+  adiw r24, SYMBOL
+
+; CHECK: adiw r26,  12               ; encoding: [0x1c,0x96]
+; CHECK: adiw r26,  63               ; encoding: [0xdf,0x96]
+
+; CHECK: adiw r28,  17               ; encoding: [0x61,0x96]
+; CHECK: adiw r28,  0                ; encoding: [0x20,0x96]
+
+; CHECK: adiw r30,  63               ; encoding: [0xff,0x96]
+; CHECK: adiw r30,  3                ; encoding: [0x33,0x96]
+
+; CHECK: adiw r24, SYMBOL            ; encoding: [0b00AAAAAA,0x96]
+                                     ;   fixup A - offset: 0, value: SYMBOL, kind: fixup_6_adiw

Added: llvm/trunk/test/MC/AVR/inst-and.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-and.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-and.s (added)
+++ llvm/trunk/test/MC/AVR/inst-and.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,14 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  and r0,  r15
+  and r15, r0
+  and r16, r31
+  and r31, r16
+
+; CHECK: and r0,  r15               ; encoding: [0x0f,0x20]
+; CHECK: and r15, r0                ; encoding: [0xf0,0x20]
+; CHECK: and r16, r31               ; encoding: [0x0f,0x23]
+; CHECK: and r31, r16               ; encoding: [0xf0,0x23]

Added: llvm/trunk/test/MC/AVR/inst-andi.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-andi.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-andi.s (added)
+++ llvm/trunk/test/MC/AVR/inst-andi.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,19 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  andi r16, 255
+  andi r29, 190
+  andi r22, 172
+  andi r27, 92
+
+  andi r20, BAR
+
+; CHECK: andi r16, 255                 ; encoding: [0x0f,0x7f]
+; CHECK: andi r29, 190                 ; encoding: [0xde,0x7b]
+; CHECK: andi r22, 172                 ; encoding: [0x6c,0x7a]
+; CHECK: andi r27, 92                  ; encoding: [0xbc,0x75]
+
+; CHECK: andi r20, BAR                 ; encoding: [0x40'A',0x70]
+; CHECK:                               ;   fixup A - offset: 0, value: BAR, kind: fixup_ldi

Added: llvm/trunk/test/MC/AVR/inst-asr.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-asr.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-asr.s (added)
+++ llvm/trunk/test/MC/AVR/inst-asr.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,14 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  asr r31
+  asr r25
+  asr r5
+  asr r0
+
+; CHECK: asr r31                ; encoding: [0xf5,0x95]
+; CHECK: asr r25                ; encoding: [0x95,0x95]
+; CHECK: asr r5                 ; encoding: [0x55,0x94]
+; CHECK: asr r0                 ; encoding: [0x05,0x94]

Added: llvm/trunk/test/MC/AVR/inst-bld.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-bld.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-bld.s (added)
+++ llvm/trunk/test/MC/AVR/inst-bld.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,14 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  bld r3, 5
+  bld r1, 1
+  bld r0, 0
+  bld r7, 2
+
+; CHECK: bld r3, 5                  ; encoding: [0x35,0xf8]
+; CHECK: bld r1, 1                  ; encoding: [0x11,0xf8]
+; CHECK: bld r0, 0                  ; encoding: [0x00,0xf8]
+; CHECK: bld r7, 2                  ; encoding: [0x72,0xf8]

Added: llvm/trunk/test/MC/AVR/inst-brbc.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-brbc.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-brbc.s (added)
+++ llvm/trunk/test/MC/AVR/inst-brbc.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,12 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  brbc 3, .+8
+  brbc 0, .-16
+
+; CHECK: brvc .Ltmp0+8              ; encoding: [0bAAAAA011,0b111101AA]
+; CHECK:                            ; fixup A - offset: 0, value: .Ltmp0+8, kind: fixup_7_pcrel
+; CHECK: brcc .Ltmp1-16             ; encoding: [0bAAAAA000,0b111101AA]
+; CHECK:                            ; fixup A - offset: 0, value: .Ltmp1-16, kind: fixup_7_pcrel

Added: llvm/trunk/test/MC/AVR/inst-brbs.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-brbs.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-brbs.s (added)
+++ llvm/trunk/test/MC/AVR/inst-brbs.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,12 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  brbs 3, .+8
+  brbs 0, .-12
+
+; CHECK: brvs .Ltmp0+8              ; encoding: [0bAAAAA011,0b111100AA]
+; CHECK:                            ; fixup A - offset: 0, value: .Ltmp0+8, kind: fixup_7_pcrel
+; CHECK: brcs .Ltmp1-12             ; encoding: [0bAAAAA000,0b111100AA]
+; CHECK:                            ; fixup A - offset: 0, value: .Ltmp1-12, kind: fixup_7_pcrel

Added: llvm/trunk/test/MC/AVR/inst-break.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-break.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-break.s (added)
+++ llvm/trunk/test/MC/AVR/inst-break.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,8 @@
+; RUN: llvm-mc -triple avr -mattr=break -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  break
+
+; CHECK: break                  ; encoding: [0x98,0x95]

Added: llvm/trunk/test/MC/AVR/inst-bst.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-bst.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-bst.s (added)
+++ llvm/trunk/test/MC/AVR/inst-bst.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,14 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  bst r3, 5
+  bst r1, 1
+  bst r0, 0
+  bst r7, 2
+
+; CHECK: bst r3, 5                  ; encoding: [0x35,0xfa]
+; CHECK: bst r1, 1                  ; encoding: [0x11,0xfa]
+; CHECK: bst r0, 0                  ; encoding: [0x00,0xfa]
+; CHECK: bst r7, 2                  ; encoding: [0x72,0xfa]

Added: llvm/trunk/test/MC/AVR/inst-call.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-call.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-call.s (added)
+++ llvm/trunk/test/MC/AVR/inst-call.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,14 @@
+; RUN: llvm-mc -triple avr -mattr=jmpcall -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  call  4096
+  call  -124
+  call   -12
+  call   0
+
+; CHECK: call  4096                 ; encoding: [0x0e,0x94,0x00,0x08]
+; CHECK: call -124                  ; encoding: [0xff,0x95,0xc2,0xff]
+; CHECK: call -12                   ; encoding: [0xff,0x95,0xfa,0xff]
+; CHECK: call  0                    ; encoding: [0x0e,0x94,0x00,0x00]

Added: llvm/trunk/test/MC/AVR/inst-cbi.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-cbi.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-cbi.s (added)
+++ llvm/trunk/test/MC/AVR/inst-cbi.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,20 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  cbi 3, 5
+  cbi 1, 1
+  cbi 0, 0
+  cbi 7, 2
+
+  cbi bar-2, 2
+
+; CHECK: cbi 3, 5                  ; encoding: [0x1d,0x98]
+; CHECK: cbi 1, 1                  ; encoding: [0x09,0x98]
+; CHECK: cbi 0, 0                  ; encoding: [0x00,0x98]
+; CHECK: cbi 7, 2                  ; encoding: [0x3a,0x98]
+
+; CHECK: cbi bar-2, 2              ; encoding: [0bAAAAA010,0x98]
+; CHECK:                           ;   fixup A - offset: 0, value: bar-2, kind: fixup_port5
+

Added: llvm/trunk/test/MC/AVR/inst-cbr.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-cbr.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-cbr.s (added)
+++ llvm/trunk/test/MC/AVR/inst-cbr.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,14 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  cbr r17, 208
+  cbr r24, 190
+  cbr r20, 173
+  cbr r31, 0
+
+; CHECK: cbr r17, 208                 ; encoding: [0x1f,0x72]
+; CHECK: cbr r24, 190                 ; encoding: [0x81,0x74]
+; CHECK: cbr r20, 173                 ; encoding: [0x42,0x75]
+; CHECK: cbr r31, 0                   ; encoding: [0xff,0x7f]

Added: llvm/trunk/test/MC/AVR/inst-clr.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-clr.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-clr.s (added)
+++ llvm/trunk/test/MC/AVR/inst-clr.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,14 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  clr r2
+  clr r12
+  clr r5
+  clr r0
+
+; CHECK: eor r2,  r2                  ; encoding: [0x22,0x24]
+; CHECK: eor r12, r12                 ; encoding: [0xcc,0x24]
+; CHECK: eor r5,  r5                  ; encoding: [0x55,0x24]
+; CHECK: eor r0,  r0                  ; encoding: [0x00,0x24]

Added: llvm/trunk/test/MC/AVR/inst-com.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-com.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-com.s (added)
+++ llvm/trunk/test/MC/AVR/inst-com.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,14 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  com r30
+  com r17
+  com r4
+  com r0
+
+; CHECK: com r30                  ; encoding: [0xe0,0x95]
+; CHECK: com r17                  ; encoding: [0x10,0x95]
+; CHECK: com r4                   ; encoding: [0x40,0x94]
+; CHECK: com r0                   ; encoding: [0x00,0x94]

Added: llvm/trunk/test/MC/AVR/inst-cp.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-cp.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-cp.s (added)
+++ llvm/trunk/test/MC/AVR/inst-cp.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,14 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  cp r12, r2
+  cp r19, r0
+  cp r15, r31
+  cp r0,  r0
+
+; CHECK: cp r12, r2                   ; encoding: [0xc2,0x14]
+; CHECK: cp r19, r0                   ; encoding: [0x30,0x15]
+; CHECK: cp r15, r31                  ; encoding: [0xff,0x16]
+; CHECK: cp r0,  r0                   ; encoding: [0x00,0x14]

Added: llvm/trunk/test/MC/AVR/inst-cpc.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-cpc.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-cpc.s (added)
+++ llvm/trunk/test/MC/AVR/inst-cpc.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,14 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  cp r13, r12
+  cp r20, r0
+  cp r10, r31
+  cp r0,  r0
+
+; CHECK: cp r13, r12                  ; encoding: [0xdc,0x14]
+; CHECK: cp r20, r0                   ; encoding: [0x40,0x15]
+; CHECK: cp r10, r31                  ; encoding: [0xaf,0x16]
+; CHECK: cp r0,  r0                   ; encoding: [0x00,0x14]

Added: llvm/trunk/test/MC/AVR/inst-cpi.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-cpi.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-cpi.s (added)
+++ llvm/trunk/test/MC/AVR/inst-cpi.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,20 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  cpi r16, 241
+  cpi r29, 190
+  cpi r22, 172
+  cpi r27, 92
+
+  cpi r21, ear
+
+; CHECK: cpi r16, 241                  ; encoding: [0x01,0x3f]
+; CHECK: cpi r29, 190                  ; encoding: [0xde,0x3b]
+; CHECK: cpi r22, 172                  ; encoding: [0x6c,0x3a]
+; CHECK: cpi r27, 92                   ; encoding: [0xbc,0x35]
+
+; CHECK: cpi r21, ear                  ; encoding: [0x50'A',0x30]
+; CHECK:                               ;   fixup A - offset: 0, value: ear, kind: fixup_ldi
+

Added: llvm/trunk/test/MC/AVR/inst-cpse.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-cpse.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-cpse.s (added)
+++ llvm/trunk/test/MC/AVR/inst-cpse.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,14 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  cpse r2, r13
+  cpse r9, r0
+  cpse r5, r31
+  cpse r3, r3
+
+; CHECK: cpse r2, r13                  ; encoding: [0x2d,0x10]
+; CHECK: cpse r9, r0                   ; encoding: [0x90,0x10]
+; CHECK: cpse r5, r31                  ; encoding: [0x5f,0x12]
+; CHECK: cpse r3, r3                   ; encoding: [0x33,0x10]

Added: llvm/trunk/test/MC/AVR/inst-dec.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-dec.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-dec.s (added)
+++ llvm/trunk/test/MC/AVR/inst-dec.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,14 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  dec r26
+  dec r3
+  dec r24
+  dec r20
+
+; CHECK: dec r26                  ; encoding: [0xaa,0x95]
+; CHECK: dec r3                   ; encoding: [0x3a,0x94]
+; CHECK: dec r24                  ; encoding: [0x8a,0x95]
+; CHECK: dec r20                  ; encoding: [0x4a,0x95]

Added: llvm/trunk/test/MC/AVR/inst-des.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-des.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-des.s (added)
+++ llvm/trunk/test/MC/AVR/inst-des.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,14 @@
+; RUN: llvm-mc -triple avr -mattr=des -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  des 0
+  des 6
+  des 1
+  des 8
+
+; CHECK: des 0                  ; encoding: [0x0b,0x94]
+; CHECK: des 6                  ; encoding: [0x6b,0x94]
+; CHECK: des 1                  ; encoding: [0x1b,0x94]
+; CHECK: des 8                  ; encoding: [0x8b,0x94]

Added: llvm/trunk/test/MC/AVR/inst-eicall.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-eicall.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-eicall.s (added)
+++ llvm/trunk/test/MC/AVR/inst-eicall.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,8 @@
+; RUN: llvm-mc -triple avr -mattr=eijmpcall -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  eicall
+
+; CHECK: eicall                  ; encoding: [0x19,0x95]

Added: llvm/trunk/test/MC/AVR/inst-eijmp.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-eijmp.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-eijmp.s (added)
+++ llvm/trunk/test/MC/AVR/inst-eijmp.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,8 @@
+; RUN: llvm-mc -triple avr -mattr=eijmpcall -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  eijmp
+
+; CHECK: eijmp                  ; encoding: [0x19,0x94]

Added: llvm/trunk/test/MC/AVR/inst-elpm.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-elpm.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-elpm.s (added)
+++ llvm/trunk/test/MC/AVR/inst-elpm.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,20 @@
+; RUN: llvm-mc -triple avr -mattr=elpm,elpmx -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  elpm
+
+  elpm r3,  Z
+  elpm r23, Z
+
+  elpm r8, Z+
+  elpm r0, Z+
+
+; CHECK: elpm                  ; encoding: [0xd8,0x95]
+
+; CHECK: elpm r3,  Z           ; encoding: [0x36,0x90]
+; CHECK: elpm r23, Z           ; encoding: [0x76,0x91]
+
+; CHECK: elpm r8, Z+           ; encoding: [0x87,0x90]
+; CHECK: elpm r0, Z+           ; encoding: [0x07,0x90]

Added: llvm/trunk/test/MC/AVR/inst-eor.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-eor.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-eor.s (added)
+++ llvm/trunk/test/MC/AVR/inst-eor.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,14 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  eor r0,  r15
+  eor r15, r0
+  eor r16, r31
+  eor r31, r16
+
+; CHECK: eor r0,  r15               ; encoding: [0x0f,0x24]
+; CHECK: eor r15, r0                ; encoding: [0xf0,0x24]
+; CHECK: eor r16, r31               ; encoding: [0x0f,0x27]
+; CHECK: eor r31, r16               ; encoding: [0xf0,0x27]

Added: llvm/trunk/test/MC/AVR/inst-family-cond-branch.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-family-cond-branch.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-family-cond-branch.s (added)
+++ llvm/trunk/test/MC/AVR/inst-family-cond-branch.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,238 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+  ; BREQ
+  breq .-18
+  breq .-12
+  brbs 1, .-18
+  brbs 1, baz
+
+; CHECK: breq    .Ltmp0-18               ; encoding: [0bAAAAA001,0b111100AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp0-18, kind: fixup_7_pcrel
+; CHECK: breq    .Ltmp1-12               ; encoding: [0bAAAAA001,0b111100AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp1-12, kind: fixup_7_pcrel
+; CHECK: brbs    1, .Ltmp2-18            ; encoding: [0bAAAAA001,0b111100AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp2-18, kind: fixup_7_pcrel
+; CHECK: brbs    1, baz                  ; encoding: [0bAAAAA001,0b111100AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: baz, kind: fixup_7_pcrel
+
+  ; BRNE
+  brne .+10
+  brne .+2
+  brbc 1, .+10
+  brbc 1, bar
+
+; CHECK: brne    .Ltmp3+10               ; encoding: [0bAAAAA001,0b111101AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp3+10, kind: fixup_7_pcrel
+; CHECK: brne    .Ltmp4+2                ; encoding: [0bAAAAA001,0b111101AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp4+2, kind: fixup_7_pcrel
+; CHECK: brbc    1, .Ltmp5+10            ; encoding: [0bAAAAA001,0b111101AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp5+10, kind: fixup_7_pcrel
+; CHECK: brbc    1, bar                  ; encoding: [0bAAAAA001,0b111101AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: bar, kind: fixup_7_pcrel
+
+bar:
+  ; BRCS
+  brcs .+8
+  brcs .+4
+  brbs 0, .+8
+  brbs 0, end
+
+; CHECK: brcs    .Ltmp6+8                ; encoding: [0bAAAAA000,0b111100AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp6+8, kind: fixup_7_pcrel
+; CHECK: brcs    .Ltmp7+4                ; encoding: [0bAAAAA000,0b111100AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp7+4, kind: fixup_7_pcrel
+; CHECK: brcs    .Ltmp8+8                ; encoding: [0bAAAAA000,0b111100AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp8+8, kind: fixup_7_pcrel
+; CHECK: brcs    end                     ; encoding: [0bAAAAA000,0b111100AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: end, kind: fixup_7_pcrel
+
+  ; BRCC
+  brcc .+66
+  brcc .-22
+  brbc 0, .+66
+  brbc 0, baz
+
+; CHECK: brcc    .Ltmp9+66               ; encoding: [0bAAAAA000,0b111101AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp9+66, kind: fixup_7_pcrel
+; CHECK: brcc    .Ltmp10-22              ; encoding: [0bAAAAA000,0b111101AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp10-22, kind: fixup_7_pcrel
+; CHECK: brcc    .Ltmp11+66              ; encoding: [0bAAAAA000,0b111101AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp11+66, kind: fixup_7_pcrel
+; CHECK: brcc    baz                     ; encoding: [0bAAAAA000,0b111101AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: baz, kind: fixup_7_pcrel
+
+  ; BRSH
+  brsh .+32
+  brsh .+70
+  brsh car
+
+; CHECK: brsh    .Ltmp12+32              ; encoding: [0bAAAAA000,0b111101AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp12+32, kind: fixup_7_pcrel
+; CHECK: brsh    .Ltmp13+70              ; encoding: [0bAAAAA000,0b111101AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp13+70, kind: fixup_7_pcrel
+; CHECK: brsh    car                     ; encoding: [0bAAAAA000,0b111101AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: car, kind: fixup_7_pcrel
+
+baz:
+
+  ; BRLO
+  brlo .+12
+  brlo .+28
+  brlo car
+
+; CHECK: brlo    .Ltmp14+12              ; encoding: [0bAAAAA000,0b111100AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp14+12, kind: fixup_7_pcrel
+; CHECK: brlo    .Ltmp15+28              ; encoding: [0bAAAAA000,0b111100AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp15+28, kind: fixup_7_pcrel
+; CHECK: brlo    car                     ; encoding: [0bAAAAA000,0b111100AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: car, kind: fixup_7_pcrel
+
+  ; BRMI
+  brmi .+66
+  brmi .+58
+  brmi car
+
+; CHECK: brmi    .Ltmp16+66              ; encoding: [0bAAAAA010,0b111100AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp16+66, kind: fixup_7_pcrel
+; CHECK: brmi    .Ltmp17+58              ; encoding: [0bAAAAA010,0b111100AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp17+58, kind: fixup_7_pcrel
+; CHECK: brmi    car                     ; encoding: [0bAAAAA010,0b111100AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: car, kind: fixup_7_pcrel
+
+  ; BRPL
+  brpl .-12
+  brpl .+18
+  brpl car
+
+; CHECK: brpl    .Ltmp18-12              ; encoding: [0bAAAAA010,0b111101AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp18-12, kind: fixup_7_pcrel
+; CHECK: brpl    .Ltmp19+18              ; encoding: [0bAAAAA010,0b111101AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp19+18, kind: fixup_7_pcrel
+; CHECK: brpl    car                     ; encoding: [0bAAAAA010,0b111101AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: car, kind: fixup_7_pcrel
+
+  ; BRGE
+  brge .+50
+  brge .+42
+  brge car
+
+; CHECK: brge    .Ltmp20+50              ; encoding: [0bAAAAA100,0b111101AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp20+50, kind: fixup_7_pcrel
+; CHECK: brge    .Ltmp21+42              ; encoding: [0bAAAAA100,0b111101AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp21+42, kind: fixup_7_pcrel
+; CHECK: brge    car                     ; encoding: [0bAAAAA100,0b111101AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: car, kind: fixup_7_pcrel
+
+car:
+  ; BRLT
+  brlt .+16
+  brlt .+2
+  brlt end
+
+; CHECK: brlt    .Ltmp22+16              ; encoding: [0bAAAAA100,0b111100AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp22+16, kind: fixup_7_pcrel
+; CHECK: brlt    .Ltmp23+2               ; encoding: [0bAAAAA100,0b111100AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp23+2, kind: fixup_7_pcrel
+; CHECK: brlt    end                     ; encoding: [0bAAAAA100,0b111100AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: end, kind: fixup_7_pcrel
+
+  ; BRHS
+  brhs .-66
+  brhs .+14
+  brhs just_another_label
+
+; CHECK: brhs    .Ltmp24-66              ; encoding: [0bAAAAA101,0b111100AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp24-66, kind: fixup_7_pcrel
+; CHECK: brhs    .Ltmp25+14              ; encoding: [0bAAAAA101,0b111100AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp25+14, kind: fixup_7_pcrel
+; CHECK: brhs    just_another_label      ; encoding: [0bAAAAA101,0b111100AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: just_another_label, kind: fixup_7_pcrel
+
+  ; BRHC
+  brhc .+12
+  brhc .+14
+  brhc just_another_label
+
+; CHECK: brhc    .Ltmp26+12              ; encoding: [0bAAAAA101,0b111101AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp26+12, kind: fixup_7_pcrel
+; CHECK: brhc    .Ltmp27+14              ; encoding: [0bAAAAA101,0b111101AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp27+14, kind: fixup_7_pcrel
+; CHECK: brhc    just_another_label      ; encoding: [0bAAAAA101,0b111101AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: just_another_label, kind: fixup_7_pcrel
+
+  ; BRTS
+  brts .+18
+  brts .+22
+  brts just_another_label
+
+; CHECK: brts    .Ltmp28+18              ; encoding: [0bAAAAA110,0b111100AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp28+18, kind: fixup_7_pcrel
+; CHECK: brts    .Ltmp29+22              ; encoding: [0bAAAAA110,0b111100AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp29+22, kind: fixup_7_pcrel
+; CHECK: brts    just_another_label      ; encoding: [0bAAAAA110,0b111100AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: just_another_label, kind: fixup_7_pcrel
+
+just_another_label:
+  ; BRTC
+  brtc .+52
+  brtc .+50
+  brtc end
+
+; CHECK: brtc    .Ltmp30+52              ; encoding: [0bAAAAA110,0b111101AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp30+52, kind: fixup_7_pcrel
+; CHECK: brtc    .Ltmp31+50              ; encoding: [0bAAAAA110,0b111101AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp31+50, kind: fixup_7_pcrel
+; CHECK: brtc    end                     ; encoding: [0bAAAAA110,0b111101AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: end, kind: fixup_7_pcrel
+
+  ; BRVS
+  brvs .+18
+  brvs .+32
+  brvs end
+
+; CHECK: brvs    .Ltmp32+18              ; encoding: [0bAAAAA011,0b111100AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp32+18, kind: fixup_7_pcrel
+; CHECK: brvs    .Ltmp33+32              ; encoding: [0bAAAAA011,0b111100AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp33+32, kind: fixup_7_pcrel
+; CHECK: brvs    end                     ; encoding: [0bAAAAA011,0b111100AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: end, kind: fixup_7_pcrel
+
+  ; BRVC
+  brvc .-28
+  brvc .-62
+  brvc end
+
+; CHECK: brvc    .Ltmp34-28              ; encoding: [0bAAAAA011,0b111101AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp34-28, kind: fixup_7_pcrel
+; CHECK: brvc    .Ltmp35-62              ; encoding: [0bAAAAA011,0b111101AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp35-62, kind: fixup_7_pcrel
+; CHECK: brvc    end                     ; encoding: [0bAAAAA011,0b111101AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: end, kind: fixup_7_pcrel
+
+  ; BRIE
+  brie .+20
+  brie .+40
+  brie end
+
+; CHECK: brie    .Ltmp36+20              ; encoding: [0bAAAAA111,0b111100AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp36+20, kind: fixup_7_pcrel
+; CHECK: brie    .Ltmp37+40              ; encoding: [0bAAAAA111,0b111100AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp37+40, kind: fixup_7_pcrel
+; CHECK: brie    end                     ; encoding: [0bAAAAA111,0b111100AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: end, kind: fixup_7_pcrel
+
+  ; BRID
+  brid .+42
+  brid .+62
+  brid end
+
+; CHECK: brid    .Ltmp38+42              ; encoding: [0bAAAAA111,0b111101AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp38+42, kind: fixup_7_pcrel
+; CHECK: brid    .Ltmp39+62              ; encoding: [0bAAAAA111,0b111101AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp39+62, kind: fixup_7_pcrel
+; CHECK: brid    end                     ; encoding: [0bAAAAA111,0b111101AA]
+; CHECK:                                 ;   fixup A - offset: 0, value: end, kind: fixup_7_pcrel
+
+end:

Added: llvm/trunk/test/MC/AVR/inst-family-set-clr-flag.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-family-set-clr-flag.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-family-set-clr-flag.s (added)
+++ llvm/trunk/test/MC/AVR/inst-family-set-clr-flag.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,105 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+foo:
+
+; Flag set operations
+
+; SEC
+bset 0
+sec
+
+; SEZ
+bset 1
+sez
+
+; SEN
+bset 2
+sen
+
+; SEV
+bset 3
+sev
+
+; SES
+bset 4
+ses
+
+; SEH
+bset 5
+seh
+
+; SET
+bset 6
+set
+
+; SEI
+bset 7
+sei
+
+; Flag clear operations
+
+; CLC
+bclr 0
+clc
+
+; CLZ
+bclr 1
+clz
+
+; CLN
+bclr 2
+cln
+
+; CLV
+bclr 3
+clv
+
+; CLS
+bclr 4
+cls
+
+; CLH
+bclr 5
+clh
+
+; CLT
+bclr 6
+clt
+
+; CLI
+bclr 7
+cli
+
+; CHECK: sec               ; encoding: [0x08,0x94]
+; CHECK: sec               ; encoding: [0x08,0x94]
+; CHECK: sez               ; encoding: [0x18,0x94]
+; CHECK: sez               ; encoding: [0x18,0x94]
+; CHECK: sen               ; encoding: [0x28,0x94]
+; CHECK: sen               ; encoding: [0x28,0x94]
+; CHECK: sev               ; encoding: [0x38,0x94]
+; CHECK: sev               ; encoding: [0x38,0x94]
+; CHECK: ses               ; encoding: [0x48,0x94]
+; CHECK: ses               ; encoding: [0x48,0x94]
+; CHECK: seh               ; encoding: [0x58,0x94]
+; CHECK: seh               ; encoding: [0x58,0x94]
+; CHECK: set               ; encoding: [0x68,0x94]
+; CHECK: set               ; encoding: [0x68,0x94]
+; CHECK: sei               ; encoding: [0x78,0x94]
+; CHECK: sei               ; encoding: [0x78,0x94]
+
+; CHECK: clc               ; encoding: [0x88,0x94]
+; CHECK: clc               ; encoding: [0x88,0x94]
+; CHECK: clz               ; encoding: [0x98,0x94]
+; CHECK: clz               ; encoding: [0x98,0x94]
+; CHECK: cln               ; encoding: [0xa8,0x94]
+; CHECK: cln               ; encoding: [0xa8,0x94]
+; CHECK: clv               ; encoding: [0xb8,0x94]
+; CHECK: clv               ; encoding: [0xb8,0x94]
+; CHECK: cls               ; encoding: [0xc8,0x94]
+; CHECK: cls               ; encoding: [0xc8,0x94]
+; CHECK: clh               ; encoding: [0xd8,0x94]
+; CHECK: clh               ; encoding: [0xd8,0x94]
+; CHECK: clt               ; encoding: [0xe8,0x94]
+; CHECK: clt               ; encoding: [0xe8,0x94]
+; CHECK: cli               ; encoding: [0xf8,0x94]
+; CHECK: cli               ; encoding: [0xf8,0x94]

Added: llvm/trunk/test/MC/AVR/inst-fmul.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-fmul.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-fmul.s (added)
+++ llvm/trunk/test/MC/AVR/inst-fmul.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,14 @@
+; RUN: llvm-mc -triple avr -mattr=mul -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  fmul r22, r16
+  fmul r19, r17
+  fmul r21, r23
+  fmul r23, r23
+
+; CHECK: fmul r22, r16                   ; encoding: [0x68,0x03]
+; CHECK: fmul r19, r17                   ; encoding: [0x39,0x03]
+; CHECK: fmul r21, r23                   ; encoding: [0x5f,0x03]
+; CHECK: fmul r23, r23                   ; encoding: [0x7f,0x03]

Added: llvm/trunk/test/MC/AVR/inst-fmuls.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-fmuls.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-fmuls.s (added)
+++ llvm/trunk/test/MC/AVR/inst-fmuls.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,14 @@
+; RUN: llvm-mc -triple avr -mattr=mul -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  fmuls r22, r16
+  fmuls r19, r17
+  fmuls r21, r23
+  fmuls r23, r23
+
+; CHECK: fmuls r22, r16                   ; encoding: [0xe0,0x03]
+; CHECK: fmuls r19, r17                   ; encoding: [0xb1,0x03]
+; CHECK: fmuls r21, r23                   ; encoding: [0xd7,0x03]
+; CHECK: fmuls r23, r23                   ; encoding: [0xf7,0x03]

Added: llvm/trunk/test/MC/AVR/inst-fmulsu.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-fmulsu.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-fmulsu.s (added)
+++ llvm/trunk/test/MC/AVR/inst-fmulsu.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,14 @@
+; RUN: llvm-mc -triple avr -mattr=mul -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  fmulsu r22, r16
+  fmulsu r19, r17
+  fmulsu r21, r23
+  fmulsu r23, r23
+
+; CHECK: fmulsu r22, r16                   ; encoding: [0xe8,0x03]
+; CHECK: fmulsu r19, r17                   ; encoding: [0xb9,0x03]
+; CHECK: fmulsu r21, r23                   ; encoding: [0xdf,0x03]
+; CHECK: fmulsu r23, r23                   ; encoding: [0xff,0x03]

Added: llvm/trunk/test/MC/AVR/inst-icall.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-icall.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-icall.s (added)
+++ llvm/trunk/test/MC/AVR/inst-icall.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,8 @@
+; RUN: llvm-mc -triple avr -mattr=ijmpcall -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  icall
+
+; CHECK: icall                  ; encoding: [0x09,0x95]

Added: llvm/trunk/test/MC/AVR/inst-ijmp.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-ijmp.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-ijmp.s (added)
+++ llvm/trunk/test/MC/AVR/inst-ijmp.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,8 @@
+; RUN: llvm-mc -triple avr -mattr=ijmpcall -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  ijmp
+
+; CHECK: ijmp                  ; encoding: [0x09,0x94]

Added: llvm/trunk/test/MC/AVR/inst-in.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-in.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-in.s (added)
+++ llvm/trunk/test/MC/AVR/inst-in.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,20 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  in r2, 4
+  in r9, 6
+  in r5, 32
+  in r0, 0
+
+  in r20, foo+1
+
+; CHECK: in r2, 4                   ; encoding: [0x24,0xb0]
+; CHECK: in r9, 6                   ; encoding: [0x96,0xb0]
+; CHECK: in r5, 32                  ; encoding: [0x50,0xb4]
+; CHECK: in r0, 0                   ; encoding: [0x00,0xb0]
+
+; CHECK: in r20, foo+1              ; encoding: [0x40'A',0xb1'A']
+; CHECK:                            ;   fixup A - offset: 0, value: foo+1, kind: fixup_port6
+

Added: llvm/trunk/test/MC/AVR/inst-inc.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-inc.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-inc.s (added)
+++ llvm/trunk/test/MC/AVR/inst-inc.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,14 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  inc r12
+  inc r29
+  inc r6
+  inc r20
+
+; CHECK: inc r12                  ; encoding: [0xc3,0x94]
+; CHECK: inc r29                  ; encoding: [0xd3,0x95]
+; CHECK: inc r6                   ; encoding: [0x63,0x94]
+; CHECK: inc r20                  ; encoding: [0x43,0x95]

Added: llvm/trunk/test/MC/AVR/inst-jmp.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-jmp.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-jmp.s (added)
+++ llvm/trunk/test/MC/AVR/inst-jmp.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,19 @@
+; RUN: llvm-mc -triple avr -mattr=jmpcall -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  jmp   200
+  jmp  -12
+  jmp   80
+  jmp   0
+
+  jmp foo+1
+
+; CHECK: jmp  200                  ; encoding: [0x0c,0x94,0x64,0x00]
+; CHECK: jmp -12                   ; encoding: [0xfd,0x95,0xfa,0xff]
+; CHECK: jmp  80                   ; encoding: [0x0c,0x94,0x28,0x00]
+; CHECK: jmp  0                    ; encoding: [0x0c,0x94,0x00,0x00]
+
+; CHECK: jmp foo+1                 ; encoding: [0x0c'A',0x94'A',0b00AAAAAA,0x00]
+; CHECK:                           ;   fixup A - offset: 0, value: foo+1, kind: fixup_call

Added: llvm/trunk/test/MC/AVR/inst-lac.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-lac.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-lac.s (added)
+++ llvm/trunk/test/MC/AVR/inst-lac.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,14 @@
+; RUN: llvm-mc -triple avr -mattr=rmw -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  lac Z, r13
+  lac Z, r0
+  lac Z, r31
+  lac Z, r3
+
+; CHECK: lac Z, r13                  ; encoding: [0xd6,0x92]
+; CHECK: lac Z, r0                   ; encoding: [0x06,0x92]
+; CHECK: lac Z, r31                  ; encoding: [0xf6,0x93]
+; CHECK: lac Z, r3                   ; encoding: [0x36,0x92]

Added: llvm/trunk/test/MC/AVR/inst-las.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-las.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-las.s (added)
+++ llvm/trunk/test/MC/AVR/inst-las.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,14 @@
+; RUN: llvm-mc -triple avr -mattr=rmw -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  las Z, r13
+  las Z, r0
+  las Z, r31
+  las Z, r3
+
+; CHECK: las Z, r13                  ; encoding: [0xd5,0x92]
+; CHECK: las Z, r0                   ; encoding: [0x05,0x92]
+; CHECK: las Z, r31                  ; encoding: [0xf5,0x93]
+; CHECK: las Z, r3                   ; encoding: [0x35,0x92]

Added: llvm/trunk/test/MC/AVR/inst-lat.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-lat.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-lat.s (added)
+++ llvm/trunk/test/MC/AVR/inst-lat.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,14 @@
+; RUN: llvm-mc -triple avr -mattr=rmw -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  lat Z, r13
+  lat Z, r0
+  lat Z, r31
+  lat Z, r3
+
+; CHECK: lat Z, r13                  ; encoding: [0xd7,0x92]
+; CHECK: lat Z, r0                   ; encoding: [0x07,0x92]
+; CHECK: lat Z, r31                  ; encoding: [0xf7,0x93]
+; CHECK: lat Z, r3                   ; encoding: [0x37,0x92]

Added: llvm/trunk/test/MC/AVR/inst-ld.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-ld.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-ld.s (added)
+++ llvm/trunk/test/MC/AVR/inst-ld.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,73 @@
+; RUN: llvm-mc -triple avr -mattr=sram -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  ; Normal
+
+  ld r10, X
+  ld r17, X
+
+  ld r30, Y
+  ld r19, Y
+
+  ld r10, Z
+  ld r2,  Z
+
+  ; Postincremenet
+
+  ld r10, X+
+  ld r17, X+
+
+  ld r30, Y+
+  ld r19, Y+
+
+  ld r10, Z+
+  ld r2,  Z+
+
+  ; Predecrement
+
+  ld r10, -X
+  ld r17, -X
+
+  ld r30, -Y
+  ld r19, -Y
+
+  ld r10, -Z
+  ld r2,  -Z
+
+
+; Normal
+
+; CHECK: ld r10,  X                 ; encoding: [0xac,0x90]
+; CHECK: ld r17,  X                 ; encoding: [0x1c,0x91]
+
+; CHECK: ld r30,  Y                 ; encoding: [0xe8,0x81]
+; CHECK: ld r19,  Y                 ; encoding: [0x38,0x81]
+
+; CHECK: ld r10,  Z                 ; encoding: [0xa0,0x80]
+; CHECK: ld r2,   Z                 ; encoding: [0x20,0x80]
+
+
+; Postincrement
+
+; CHECK: ld r10,  X+                ; encoding: [0xad,0x90]
+; CHECK: ld r17,  X+                ; encoding: [0x1d,0x91]
+
+; CHECK: ld r30,  Y+                ; encoding: [0xe9,0x91]
+; CHECK: ld r19,  Y+                ; encoding: [0x39,0x91]
+
+; CHECK: ld r10,  Z+                ; encoding: [0xa1,0x90]
+; CHECK: ld r2,   Z+                ; encoding: [0x21,0x90]
+
+
+; Predecrement
+
+; CHECK: ld r10, -X                 ; encoding: [0xae,0x90]
+; CHECK: ld r17, -X                 ; encoding: [0x1e,0x91]
+
+; CHECK: ld r30, -Y                 ; encoding: [0xea,0x91]
+; CHECK: ld r19, -Y                 ; encoding: [0x3a,0x91]
+
+; CHECK: ld r10, -Z                 ; encoding: [0xa2,0x90]
+; CHECK: ld r2,  -Z                 ; encoding: [0x22,0x90]

Added: llvm/trunk/test/MC/AVR/inst-ldd.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-ldd.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-ldd.s (added)
+++ llvm/trunk/test/MC/AVR/inst-ldd.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,20 @@
+; RUN: llvm-mc -triple avr -mattr=sram -show-encoding < %s | FileCheck %s
+
+
+foo:
+  ldd r2, Y+2
+  ldd r0, Y+0
+
+  ldd r9, Z+12
+  ldd r7, Z+30
+
+  ldd r9, Z+foo
+
+; CHECK: ldd r2, Y+2                  ; encoding: [0x2a,0x80]
+; CHECK: ldd r0, Y+0                  ; encoding: [0x08,0x80]
+
+; CHECK: ldd r9, Z+12                 ; encoding: [0x94,0x84]
+; CHECK: ldd r7, Z+30                 ; encoding: [0x76,0x8c]
+
+; CHECK: ldd r9, Z+foo                ; encoding: [0x90'A',0x80'A']
+; CHECK:                              ;   fixup A - offset: 0, value: +foo, kind: fixup_6

Added: llvm/trunk/test/MC/AVR/inst-ldi.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-ldi.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-ldi.s (added)
+++ llvm/trunk/test/MC/AVR/inst-ldi.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,17 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+  ldi r16, 241
+  ldi r29, 190
+  ldi r22, 172
+  ldi r27, 92
+  ldi r21, SYMBOL+3
+
+; CHECK: ldi r16, 241                 ; encoding: [0x01,0xef]
+; CHECK: ldi r29, 190                 ; encoding: [0xde,0xeb]
+; CHECK: ldi r22, 172                 ; encoding: [0x6c,0xea]
+; CHECK: ldi r27, 92                  ; encoding: [0xbc,0xe5]
+
+; CHECK: ldi r21, SYMBOL+3            ; encoding: [0x50'A',0xe0]
+; CHECK:                              ;   fixup A - offset: 0, value: SYMBOL+3, kind: fixup_ldi

Added: llvm/trunk/test/MC/AVR/inst-lds.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-lds.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-lds.s (added)
+++ llvm/trunk/test/MC/AVR/inst-lds.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,16 @@
+; RUN: llvm-mc -triple avr -mattr=sram -show-encoding < %s | FileCheck %s
+
+
+foo:
+  lds r16, 241
+  lds r29, 190
+  lds r22, 172
+  lds r27, 92
+  lds r4, SYMBOL+12
+
+; CHECK: lds r16, 241                 ; encoding: [0x00,0x91,0xf1,0x00]
+; CHECK: lds r29, 190                 ; encoding: [0xd0,0x91,0xbe,0x00]
+; CHECK: lds r22, 172                 ; encoding: [0x60,0x91,0xac,0x00]
+; CHECK: lds r27, 92                  ; encoding: [0xb0,0x91,0x5c,0x00]
+; CHECK: lds r4, SYMBOL+12            ; encoding: [0x40'A',0x90'A',0x00,0x00]
+; CHECK:                              ;   fixup A - offset: 0, value: SYMBOL+12, kind: fixup_16

Added: llvm/trunk/test/MC/AVR/inst-lpm.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-lpm.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-lpm.s (added)
+++ llvm/trunk/test/MC/AVR/inst-lpm.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,20 @@
+; RUN: llvm-mc -triple avr -mattr=lpm,lpmx -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  lpm
+
+  lpm r3,  Z
+  lpm r23, Z
+
+  lpm r8, Z+
+  lpm r0, Z+
+
+; CHECK: lpm                  ; encoding: [0xc8,0x95]
+
+; CHECK: lpm r3,  Z           ; encoding: [0x34,0x90]
+; CHECK: lpm r23, Z           ; encoding: [0x74,0x91]
+
+; CHECK: lpm r8, Z+           ; encoding: [0x85,0x90]
+; CHECK: lpm r0, Z+           ; encoding: [0x05,0x90]

Added: llvm/trunk/test/MC/AVR/inst-lsl.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-lsl.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-lsl.s (added)
+++ llvm/trunk/test/MC/AVR/inst-lsl.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,14 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  lsl r31
+  lsl r25
+  lsl r5
+  lsl r0
+
+; CHECK: lsl r31                ; encoding: [0xff,0x0f]
+; CHECK: lsl r25                ; encoding: [0x99,0x0f]
+; CHECK: lsl r5                 ; encoding: [0x55,0x0c]
+; CHECK: lsl r0                 ; encoding: [0x00,0x0c]

Added: llvm/trunk/test/MC/AVR/inst-lsr.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-lsr.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-lsr.s (added)
+++ llvm/trunk/test/MC/AVR/inst-lsr.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,14 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  lsr r31
+  lsr r25
+  lsr r5
+  lsr r0
+
+; CHECK: lsr r31                ; encoding: [0xf6,0x95]
+; CHECK: lsr r25                ; encoding: [0x96,0x95]
+; CHECK: lsr r5                 ; encoding: [0x56,0x94]
+; CHECK: lsr r0                 ; encoding: [0x06,0x94]

Added: llvm/trunk/test/MC/AVR/inst-mov.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-mov.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-mov.s (added)
+++ llvm/trunk/test/MC/AVR/inst-mov.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,14 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  mov r2, r13
+  mov r9, r0
+  mov r5, r31
+  mov r3, r3
+
+; CHECK: mov r2, r13                  ; encoding: [0x2d,0x2c]
+; CHECK: mov r9, r0                   ; encoding: [0x90,0x2c]
+; CHECK: mov r5, r31                  ; encoding: [0x5f,0x2e]
+; CHECK: mov r3, r3                   ; encoding: [0x33,0x2c]

Added: llvm/trunk/test/MC/AVR/inst-movw.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-movw.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-movw.s (added)
+++ llvm/trunk/test/MC/AVR/inst-movw.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,14 @@
+; RUN: llvm-mc -triple avr -mattr=movw -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  movw r10, r8
+  movw r12, r16
+  movw r20, r22
+  movw r8,  r12
+
+; CHECK: movw r10, r8            ; encoding: [0x54,0x01]
+; CHECK: movw r12, r16           ; encoding: [0x68,0x01]
+; CHECK: movw r20, r22           ; encoding: [0xab,0x01]
+; CHECK: movw r8,  r12           ; encoding: [0x46,0x01]

Added: llvm/trunk/test/MC/AVR/inst-mul.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-mul.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-mul.s (added)
+++ llvm/trunk/test/MC/AVR/inst-mul.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,13 @@
+; RUN: llvm-mc -triple avr -mattr=mul -show-encoding < %s | FileCheck %s
+
+
+foo:
+  mul r0,  r15
+  mul r15, r0
+  mul r16, r31
+  mul r31, r16
+
+; CHECK: mul r0,  r15               ; encoding: [0x0f,0x9c]
+; CHECK: mul r15, r0                ; encoding: [0xf0,0x9c]
+; CHECK: mul r16, r31               ; encoding: [0x0f,0x9f]
+; CHECK: mul r31, r16               ; encoding: [0xf0,0x9f]

Added: llvm/trunk/test/MC/AVR/inst-muls.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-muls.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-muls.s (added)
+++ llvm/trunk/test/MC/AVR/inst-muls.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,14 @@
+; RUN: llvm-mc -triple avr -mattr=mul -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  muls r22, r16
+  muls r19, r17
+  muls r28, r31
+  muls r31, r31
+
+; CHECK: muls r22, r16                   ; encoding: [0x60,0x02]
+; CHECK: muls r19, r17                   ; encoding: [0x31,0x02]
+; CHECK: muls r28, r31                   ; encoding: [0xcf,0x02]
+; CHECK: muls r31, r31                   ; encoding: [0xff,0x02]

Added: llvm/trunk/test/MC/AVR/inst-mulsu.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-mulsu.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-mulsu.s (added)
+++ llvm/trunk/test/MC/AVR/inst-mulsu.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,14 @@
+; RUN: llvm-mc -triple avr -mattr=mul -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  mulsu r22, r16
+  mulsu r19, r17
+  mulsu r21, r23
+  mulsu r23, r23
+
+; CHECK: mulsu r22, r16                   ; encoding: [0x60,0x03]
+; CHECK: mulsu r19, r17                   ; encoding: [0x31,0x03]
+; CHECK: mulsu r21, r23                   ; encoding: [0x57,0x03]
+; CHECK: mulsu r23, r23                   ; encoding: [0x77,0x03]

Added: llvm/trunk/test/MC/AVR/inst-neg.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-neg.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-neg.s (added)
+++ llvm/trunk/test/MC/AVR/inst-neg.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,12 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+foo:
+  neg r15
+  neg r1
+  neg r22
+  neg r31
+
+; CHECK: neg r15                  ; encoding: [0xf1,0x94]
+; CHECK: neg r1                   ; encoding: [0x11,0x94]
+; CHECK: neg r22                  ; encoding: [0x61,0x95]
+; CHECK: neg r31                  ; encoding: [0xf1,0x95]

Added: llvm/trunk/test/MC/AVR/inst-nop.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-nop.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-nop.s (added)
+++ llvm/trunk/test/MC/AVR/inst-nop.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,8 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  nop
+
+; CHECK: nop                  ; encoding: [0x00,0x00]

Added: llvm/trunk/test/MC/AVR/inst-or.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-or.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-or.s (added)
+++ llvm/trunk/test/MC/AVR/inst-or.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,13 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+  or r0,  r15
+  or r15, r0
+  or r16, r31
+  or r31, r16
+
+; CHECK: or r0,  r15               ; encoding: [0x0f,0x28]
+; CHECK: or r15, r0                ; encoding: [0xf0,0x28]
+; CHECK: or r16, r31               ; encoding: [0x0f,0x2b]
+; CHECK: or r31, r16               ; encoding: [0xf0,0x2b]

Added: llvm/trunk/test/MC/AVR/inst-ori.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-ori.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-ori.s (added)
+++ llvm/trunk/test/MC/AVR/inst-ori.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,19 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  ori r17, 208
+  ori r24, 190
+  ori r20, 173
+  ori r31, 0
+
+  ori r16, FOOBAR
+
+; CHECK: ori r17, 208           ; encoding: [0x10,0x6d]
+; CHECK: ori r24, 190           ; encoding: [0x8e,0x6b]
+; CHECK: ori r20, 173           ; encoding: [0x4d,0x6a]
+; CHECK: ori r31, 0             ; encoding: [0xf0,0x60]
+
+; CHECK: ori r16, FOOBAR        ; encoding: [A,0x60]
+; CHECK:                        ;   fixup A - offset: 0, value: FOOBAR, kind: fixup_ldi

Added: llvm/trunk/test/MC/AVR/inst-out.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-out.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-out.s (added)
+++ llvm/trunk/test/MC/AVR/inst-out.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,20 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  out 4,  r2
+  out 6,  r9
+  out 32, r5
+  out 0,  r0
+
+  out bar-8, r29
+
+; CHECK: out 4,  r2                  ; encoding: [0x24,0xb8]
+; CHECK: out 6,  r9                  ; encoding: [0x96,0xb8]
+; CHECK: out 32, r5                  ; encoding: [0x50,0xbc]
+; CHECK: out 0,  r0                  ; encoding: [0x00,0xb8]
+
+; CHECK: out bar-8, r29              ; encoding: [0xd0'A',0xb9'A']
+; CHECK:                             ;   fixup A - offset: 0, value: bar-8, kind: fixup_port6
+

Added: llvm/trunk/test/MC/AVR/inst-pop.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-pop.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-pop.s (added)
+++ llvm/trunk/test/MC/AVR/inst-pop.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,14 @@
+; RUN: llvm-mc -triple avr -mattr=sram -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  pop r31
+  pop r25
+  pop r5
+  pop r0
+
+; CHECK: pop r31                ; encoding: [0xff,0x91]
+; CHECK: pop r25                ; encoding: [0x9f,0x91]
+; CHECK: pop r5                 ; encoding: [0x5f,0x90]
+; CHECK: pop r0                 ; encoding: [0x0f,0x90]

Added: llvm/trunk/test/MC/AVR/inst-push.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-push.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-push.s (added)
+++ llvm/trunk/test/MC/AVR/inst-push.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,14 @@
+; RUN: llvm-mc -triple avr -mattr=sram -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  push r31
+  push r25
+  push r5
+  push r0
+
+; CHECK: push r31                ; encoding: [0xff,0x93]
+; CHECK: push r25                ; encoding: [0x9f,0x93]
+; CHECK: push r5                 ; encoding: [0x5f,0x92]
+; CHECK: push r0                 ; encoding: [0x0f,0x92]

Added: llvm/trunk/test/MC/AVR/inst-rcall.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-rcall.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-rcall.s (added)
+++ llvm/trunk/test/MC/AVR/inst-rcall.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,19 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  rcall  .+0
+  rcall  .-8
+  rcall  .+12
+  rcall  .+46
+
+; CHECK: rcall  .Ltmp0+0             ; encoding: [A,0b1101AAAA]
+; CHECK:                             ;   fixup A - offset: 0, value: .Ltmp0+0, kind: fixup_13_pcrel
+; CHECK: rcall  .Ltmp1-8             ; encoding: [A,0b1101AAAA]
+; CHECK:                             ;   fixup A - offset: 0, value: .Ltmp1-8, kind: fixup_13_pcrel
+; CHECK: rcall  .Ltmp2+12            ; encoding: [A,0b1101AAAA]
+; CHECK:                             ;   fixup A - offset: 0, value: .Ltmp2+12, kind: fixup_13_pcrel
+; CHECK: rcall  .Ltmp3+46            ; encoding: [A,0b1101AAAA]
+; CHECK:                             ;   fixup A - offset: 0, value: .Ltmp3+46, kind: fixup_13_pcrel
+

Added: llvm/trunk/test/MC/AVR/inst-ret.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-ret.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-ret.s (added)
+++ llvm/trunk/test/MC/AVR/inst-ret.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,8 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  ret
+
+; CHECK: ret                  ; encoding: [0x08,0x95]

Added: llvm/trunk/test/MC/AVR/inst-reti.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-reti.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-reti.s (added)
+++ llvm/trunk/test/MC/AVR/inst-reti.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,8 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  reti
+
+; CHECK: reti                  ; encoding: [0x18,0x95]

Added: llvm/trunk/test/MC/AVR/inst-rjmp.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-rjmp.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-rjmp.s (added)
+++ llvm/trunk/test/MC/AVR/inst-rjmp.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,31 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  rjmp  .+2
+  rjmp  .-2
+  rjmp  foo
+  rjmp  .+8
+  rjmp  end
+  rjmp  .+0
+end:
+  rjmp .-4
+  rjmp .-6
+
+; CHECK: rjmp    .Ltmp0+2                ; encoding: [A,0b1100AAAA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp0+2, kind: fixup_13_pcrel
+; CHECK: rjmp    .Ltmp1-2                ; encoding: [A,0b1100AAAA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp1-2, kind: fixup_13_pcrel
+; CHECK: rjmp    foo                     ; encoding: [A,0b1100AAAA]
+; CHECK:                                 ;   fixup A - offset: 0, value: foo, kind: fixup_13_pcrel
+; CHECK: rjmp    .Ltmp2+8                ; encoding: [A,0b1100AAAA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp2+8, kind: fixup_13_pcrel
+; CHECK: rjmp    end                     ; encoding: [A,0b1100AAAA]
+; CHECK:                                 ;   fixup A - offset: 0, value: end, kind: fixup_13_pcrel
+; CHECK: rjmp    .Ltmp3+0                ; encoding: [A,0b1100AAAA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp3+0, kind: fixup_13_pcrel
+; CHECK: rjmp    .Ltmp4-4                ; encoding: [A,0b1100AAAA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp4-4, kind: fixup_13_pcrel
+; CHECK: rjmp    .Ltmp5-6                ; encoding: [A,0b1100AAAA]
+; CHECK:                                 ;   fixup A - offset: 0, value: .Ltmp5-6, kind: fixup_13_pcrel

Added: llvm/trunk/test/MC/AVR/inst-rol.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-rol.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-rol.s (added)
+++ llvm/trunk/test/MC/AVR/inst-rol.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,14 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  rol r31
+  rol r25
+  rol r5
+  rol r0
+
+; CHECK: rol r31                ; encoding: [0xff,0x1f]
+; CHECK: rol r25                ; encoding: [0x99,0x1f]
+; CHECK: rol r5                 ; encoding: [0x55,0x1c]
+; CHECK: rol r0                 ; encoding: [0x00,0x1c]

Added: llvm/trunk/test/MC/AVR/inst-ror.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-ror.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-ror.s (added)
+++ llvm/trunk/test/MC/AVR/inst-ror.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,14 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  ror r31
+  ror r25
+  ror r5
+  ror r0
+
+; CHECK: ror r31                ; encoding: [0xf7,0x95]
+; CHECK: ror r25                ; encoding: [0x97,0x95]
+; CHECK: ror r5                 ; encoding: [0x57,0x94]
+; CHECK: ror r0                 ; encoding: [0x07,0x94]

Added: llvm/trunk/test/MC/AVR/inst-sbc.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-sbc.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-sbc.s (added)
+++ llvm/trunk/test/MC/AVR/inst-sbc.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,14 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  sbc r0,  r15
+  sbc r15, r0
+  sbc r16, r31
+  sbc r31, r16
+
+; CHECK: sbc r0,  r15               ; encoding: [0x0f,0x08]
+; CHECK: sbc r15, r0                ; encoding: [0xf0,0x08]
+; CHECK: sbc r16, r31               ; encoding: [0x0f,0x0b]
+; CHECK: sbc r31, r16               ; encoding: [0xf0,0x0b]

Added: llvm/trunk/test/MC/AVR/inst-sbci.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-sbci.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-sbci.s (added)
+++ llvm/trunk/test/MC/AVR/inst-sbci.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,18 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  sbci r17, 21
+  sbci r23, 196
+  sbci r30, 244
+  sbci r19, 16
+  sbci r22, FOO
+
+; CHECK: sbci r17, 21                 ; encoding: [0x15,0x41]
+; CHECK: sbci r23, 196                ; encoding: [0x74,0x4c]
+; CHECK: sbci r30, 244                ; encoding: [0xe4,0x4f]
+; CHECK: sbci r19, 16                 ; encoding: [0x30,0x41]
+
+; CHECK: sbci r22, FOO                ; encoding: [0x60'A',0x40]
+; CHECK:                              ;   fixup A - offset: 0, value: FOO, kind: fixup_ldi

Added: llvm/trunk/test/MC/AVR/inst-sbi.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-sbi.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-sbi.s (added)
+++ llvm/trunk/test/MC/AVR/inst-sbi.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,20 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  sbi 3, 5
+  sbi 1, 1
+  sbi 0, 0
+  sbi 7, 2
+
+  sbi main, 0
+
+; CHECK: sbi 3, 5                  ; encoding: [0x1d,0x9a]
+; CHECK: sbi 1, 1                  ; encoding: [0x09,0x9a]
+; CHECK: sbi 0, 0                  ; encoding: [0x00,0x9a]
+; CHECK: sbi 7, 2                  ; encoding: [0x3a,0x9a]
+
+; CHECK: sbi main, 0               ; encoding: [0bAAAAA000,0x9a]
+; CHECK:                           ;   fixup A - offset: 0, value: main, kind: fixup_port5
+

Added: llvm/trunk/test/MC/AVR/inst-sbic.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-sbic.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-sbic.s (added)
+++ llvm/trunk/test/MC/AVR/inst-sbic.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,19 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  sbic 4,  3
+  sbic 6,  2
+  sbic 16, 5
+  sbic 0,  0
+
+  sbic foo+1, 1
+
+; CHECK: sbic 4,  3                  ; encoding: [0x23,0x99]
+; CHECK: sbic 6,  2                  ; encoding: [0x32,0x99]
+; CHECK: sbic 16, 5                  ; encoding: [0x85,0x99]
+; CHECK: sbic 0,  0                  ; encoding: [0x00,0x99]
+
+; CHECK: sbic foo+1, 1               ; encoding: [0bAAAAA001,0x99]
+; CHECK:                             ;   fixup A - offset: 0, value: foo+1, kind: fixup_port5

Added: llvm/trunk/test/MC/AVR/inst-sbis.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-sbis.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-sbis.s (added)
+++ llvm/trunk/test/MC/AVR/inst-sbis.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,18 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+  sbis 4,  3
+  sbis 6,  2
+  sbis 16, 5
+  sbis 0,  0
+
+  sbis FOO+4, 7
+
+; CHECK: sbis 4,  3                  ; encoding: [0x23,0x9b]
+; CHECK: sbis 6,  2                  ; encoding: [0x32,0x9b]
+; CHECK: sbis 16, 5                  ; encoding: [0x85,0x9b]
+; CHECK: sbis 0,  0                  ; encoding: [0x00,0x9b]
+
+; CHECK: sbis FOO+4, 7               ; encoding: [0bAAAAA111,0x9b]
+; CHECK:                             ;   fixup A - offset: 0, value: FOO+4, kind: fixup_port5

Added: llvm/trunk/test/MC/AVR/inst-sbiw.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-sbiw.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-sbiw.s (added)
+++ llvm/trunk/test/MC/AVR/inst-sbiw.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,33 @@
+; RUN: llvm-mc -triple avr -mattr=addsubiw -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  sbiw r26, 54
+  sbiw X,   63
+
+  sbiw 28,  52
+  sbiw r28, 0
+
+  sbiw r30, 63
+  sbiw Z,   47
+
+  sbiw r24, 1
+  sbiw r24, 2
+
+  sbiw r24, SYMBOL-1
+
+; CHECK: sbiw r26,  54                 ; encoding: [0xd6,0x97]
+; CHECK: sbiw r26,  63                 ; encoding: [0xdf,0x97]
+
+; CHECK: sbiw r28,  52                 ; encoding: [0xe4,0x97]
+; CHECK: sbiw r28,  0                  ; encoding: [0x20,0x97]
+
+; CHECK: sbiw r30,  63                 ; encoding: [0xff,0x97]
+; CHECK: sbiw r30,  47                 ; encoding: [0xbf,0x97]
+
+; CHECK: sbiw r24,  1                  ; encoding: [0x01,0x97]
+; CHECK: sbiw r24,  2                  ; encoding: [0x02,0x97]
+
+; CHECK: sbiw    r24, SYMBOL-1         ; encoding: [0b00AAAAAA,0x97]
+                                       ;   fixup A - offset: 0, value: SYMBOL-1, kind: fixup_6_adiw

Added: llvm/trunk/test/MC/AVR/inst-sbr.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-sbr.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-sbr.s (added)
+++ llvm/trunk/test/MC/AVR/inst-sbr.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,18 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+  sbr r17, 208
+  sbr r24, 190
+  sbr r20, 173
+  sbr r31, 0
+
+  sbr r19, _start
+
+; CHECK: sbr r17, 208                  ; encoding: [0x10,0x6d]
+; CHECK: sbr r24, 190                  ; encoding: [0x8e,0x6b]
+; CHECK: sbr r20, 173                  ; encoding: [0x4d,0x6a]
+; CHECK: sbr r31, 0                    ; encoding: [0xf0,0x60]
+
+; CHECK: sbr     r19, _start           ; encoding: [0x30'A',0x60]
+; CHECK:                               ;   fixup A - offset: 0, value: _start, kind: fixup_ldi

Added: llvm/trunk/test/MC/AVR/inst-sbrc.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-sbrc.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-sbrc.s (added)
+++ llvm/trunk/test/MC/AVR/inst-sbrc.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,11 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  sbrc r2, 3
+  sbrc r0, 7
+
+; CHECK: sbrc r2, 3                  ; encoding: [0x23,0xfc]
+; CHECK: sbrc r0, 7                  ; encoding: [0x07,0xfc]
+

Added: llvm/trunk/test/MC/AVR/inst-sbrs.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-sbrs.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-sbrs.s (added)
+++ llvm/trunk/test/MC/AVR/inst-sbrs.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,11 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  sbrs r2, 3
+  sbrs r0, 7
+
+; CHECK: sbrs r2, 3                  ; encoding: [0x23,0xfe]
+; CHECK: sbrs r0, 7                  ; encoding: [0x07,0xfe]
+

Added: llvm/trunk/test/MC/AVR/inst-ser.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-ser.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-ser.s (added)
+++ llvm/trunk/test/MC/AVR/inst-ser.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,13 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+  ser r16
+  ser r31
+  ser r27
+  ser r31
+
+; CHECK: ldi r16, 255              ; encoding: [0x0f,0xef]
+; CHECK: ldi r31, 255              ; encoding: [0xff,0xef]
+; CHECK: ldi r27, 255              ; encoding: [0xbf,0xef]
+; CHECK: ldi r31, 255              ; encoding: [0xff,0xef]

Added: llvm/trunk/test/MC/AVR/inst-sleep.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-sleep.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-sleep.s (added)
+++ llvm/trunk/test/MC/AVR/inst-sleep.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,8 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  sleep
+
+; CHECK: sleep                  ; encoding: [0x88,0x95]

Added: llvm/trunk/test/MC/AVR/inst-spm.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-spm.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-spm.s (added)
+++ llvm/trunk/test/MC/AVR/inst-spm.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,10 @@
+; RUN: llvm-mc -triple avr -mattr=spm,spmx -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  spm
+  spm Z+
+
+; CHECK: spm                  ; encoding: [0xe8,0x95]
+; CHECK: spm Z+               ; encoding: [0xf8,0x95]

Added: llvm/trunk/test/MC/AVR/inst-st.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-st.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-st.s (added)
+++ llvm/trunk/test/MC/AVR/inst-st.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,71 @@
+; RUN: llvm-mc -triple avr -mattr=sram -show-encoding < %s | FileCheck %s
+
+
+foo:
+  ; Normal
+
+  st X,  r10
+  st X,  r17
+
+  st Y,  r30
+  st Y,  r19
+
+  st Z,  r10
+  st Z,  r2
+
+  ; Postincrement
+
+  st X+,  r10
+  st X+,  r17
+
+  st Y+,  r30
+  st Y+,  r19
+
+  st Z+,  r10
+  st Z+,  r2
+
+  ; Predecrement
+
+  st -X,  r10
+  st -X,  r17
+
+  st -Y,  r30
+  st -Y,  r19
+
+  st -Z,  r10
+  st -Z,  r2
+
+; Normal
+
+; CHECK: st X,   r10                  ; encoding: [0xac,0x92]
+; CHECK: st X,   r17                  ; encoding: [0x1c,0x93]
+
+; CHECK: st Y,   r30                  ; encoding: [0xe8,0x83]
+; CHECK: st Y,   r19                  ; encoding: [0x38,0x83]
+
+; CHECK: st Z,   r10                  ; encoding: [0xa0,0x82]
+; CHECK: st Z,   r2                   ; encoding: [0x20,0x82]
+
+
+; Postincrement
+
+; CHECK: st X+,  r10                  ; encoding: [0xad,0x92]
+; CHECK: st X+,  r17                  ; encoding: [0x1d,0x93]
+
+; CHECK: st Y+,  r30                  ; encoding: [0xe9,0x93]
+; CHECK: st Y+,  r19                  ; encoding: [0x39,0x93]
+
+; CHECK: st Z+,  r10                  ; encoding: [0xa1,0x92]
+; CHECK: st Z+,  r2                   ; encoding: [0x21,0x92]
+
+
+; Predecrement
+
+; CHECK: st -X,  r10                  ; encoding: [0xae,0x92]
+; CHECK: st -X,  r17                  ; encoding: [0x1e,0x93]
+
+; CHECK: st -Y,  r30                  ; encoding: [0xea,0x93]
+; CHECK: st -Y,  r19                  ; encoding: [0x3a,0x93]
+
+; CHECK: st -Z,  r10                  ; encoding: [0xa2,0x92]
+; CHECK: st -Z,  r2                   ; encoding: [0x22,0x92]

Added: llvm/trunk/test/MC/AVR/inst-std.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-std.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-std.s (added)
+++ llvm/trunk/test/MC/AVR/inst-std.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,22 @@
+; RUN: llvm-mc -triple avr -mattr=sram -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  std Y+2, r2
+  std Y+0, r0
+
+  std Z+12, r9
+  std Z+30, r7
+
+  std Y+foo, r9
+
+; CHECK: std Y+2,  r2                 ; encoding: [0x2a,0x82]
+; CHECK: std Y+0,  r0                 ; encoding: [0x08,0x82]
+
+; CHECK: std Z+12, r9                 ; encoding: [0x94,0x86]
+; CHECK: std Z+30, r7                 ; encoding: [0x76,0x8e]
+
+; CHECK: std Y+foo, r9                ; encoding: [0x98'A',0x82'A']
+; CHECK:                              ;   fixup A - offset: 0, value: +foo, kind: fixup_6
+

Added: llvm/trunk/test/MC/AVR/inst-sts.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-sts.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-sts.s (added)
+++ llvm/trunk/test/MC/AVR/inst-sts.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,14 @@
+; RUN: llvm-mc -triple avr -mattr=sram -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  sts 3,   r5
+  sts 255, r7
+  sts SYMBOL+1, r25
+
+; CHECK:  sts 3,   r5                 ; encoding: [0x50,0x92,0x03,0x00]
+; CHECK:  sts 255, r7                 ; encoding: [0x70,0x92,0xff,0x00]
+; CHECK:  sts SYMBOL+1, r25           ; encoding: [0x90'A',0x93'A',0x00,0x00]
+; CHECK:                              ;   fixup A - offset: 0, value: SYMBOL+1, kind: fixup_16
+

Added: llvm/trunk/test/MC/AVR/inst-sub.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-sub.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-sub.s (added)
+++ llvm/trunk/test/MC/AVR/inst-sub.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,13 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+  sub r0,  r15
+  sub r15, r0
+  sub r16, r31
+  sub r31, r16
+
+; CHECK: sub r0,  r15               ; encoding: [0x0f,0x18]
+; CHECK: sub r15, r0                ; encoding: [0xf0,0x18]
+; CHECK: sub r16, r31               ; encoding: [0x0f,0x1b]
+; CHECK: sub r31, r16               ; encoding: [0xf0,0x1b]

Added: llvm/trunk/test/MC/AVR/inst-subi.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-subi.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-subi.s (added)
+++ llvm/trunk/test/MC/AVR/inst-subi.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,18 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+  subi r22, 82
+  subi r27, 39
+  subi r31, 244
+  subi r16, 144
+
+  subi r20, EXTERN_SYMBOL+0
+
+; CHECK: subi r22, 82                  ; encoding: [0x62,0x55]
+; CHECK: subi r27, 39                  ; encoding: [0xb7,0x52]
+; CHECK: subi r31, 244                 ; encoding: [0xf4,0x5f]
+; CHECK: subi r16, 144                 ; encoding: [0x00,0x59]
+
+; CHECK: subi    r20, EXTERN_SYMBOL+0  ; encoding: [0x40'A',0x50]
+; CHECK:                               ;   fixup A - offset: 0, value: EXTERN_SYMBOL+0, kind: fixup_ldi

Added: llvm/trunk/test/MC/AVR/inst-swap.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-swap.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-swap.s (added)
+++ llvm/trunk/test/MC/AVR/inst-swap.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,14 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  swap r31
+  swap r25
+  swap r5
+  swap r0
+
+; CHECK: swap r31                ; encoding: [0xf2,0x95]
+; CHECK: swap r25                ; encoding: [0x92,0x95]
+; CHECK: swap r5                 ; encoding: [0x52,0x94]
+; CHECK: swap r0                 ; encoding: [0x02,0x94]

Added: llvm/trunk/test/MC/AVR/inst-tst.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-tst.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-tst.s (added)
+++ llvm/trunk/test/MC/AVR/inst-tst.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,14 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  tst r3
+  tst r14
+  tst r24
+  tst r12
+
+; CHECK: tst r3               ; encoding: [0x33,0x20]
+; CHECK: tst r14              ; encoding: [0xee,0x20]
+; CHECK: tst r24              ; encoding: [0x88,0x23]
+; CHECK: tst r12              ; encoding: [0xcc,0x20]

Added: llvm/trunk/test/MC/AVR/inst-wdr.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-wdr.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-wdr.s (added)
+++ llvm/trunk/test/MC/AVR/inst-wdr.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,8 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  wdr
+
+; CHECK: wdr                  ; encoding: [0xa8,0x95]

Added: llvm/trunk/test/MC/AVR/inst-xch.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/inst-xch.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/inst-xch.s (added)
+++ llvm/trunk/test/MC/AVR/inst-xch.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,14 @@
+; RUN: llvm-mc -triple avr -mattr=rmw -show-encoding < %s | FileCheck %s
+
+
+foo:
+
+  xch Z, r13
+  xch Z, r0
+  xch Z, r31
+  xch Z, r3
+
+; CHECK: xch Z, r13                  ; encoding: [0xd4,0x92]
+; CHECK: xch Z, r0                   ; encoding: [0x04,0x92]
+; CHECK: xch Z, r31                  ; encoding: [0xf4,0x93]
+; CHECK: xch Z, r3                   ; encoding: [0x34,0x92]

Added: llvm/trunk/test/MC/AVR/lit.local.cfg
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/lit.local.cfg?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/lit.local.cfg (added)
+++ llvm/trunk/test/MC/AVR/lit.local.cfg Wed Nov  9 17:46:25 2016
@@ -0,0 +1,3 @@
+if not 'AVR' in config.root.targets:
+    config.unsupported = True
+

Added: llvm/trunk/test/MC/AVR/modifiers.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/modifiers.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/modifiers.s (added)
+++ llvm/trunk/test/MC/AVR/modifiers.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,203 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+; TODO: Add support for lo8(-foo + 3), and add test
+; FIXME: most of these tests use values (i.e. 0x0815) that are out of bounds.
+
+foo:
+
+    ldi r24, lo8(0x42)
+    ldi r24, lo8(0x2342)
+
+    ldi r24, lo8(0x23)
+    ldi r24, hi8(0x2342)
+
+; CHECK: ldi  r24, lo8(66)          ; encoding: [0x82,0xe4]
+; CHECK: ldi  r24, lo8(9026)        ; encoding: [0x82,0xe4]
+
+; CHECK: ldi  r24, lo8(35)          ; encoding: [0x83,0xe2]
+; CHECK: ldi  r24, hi8(9026)        ; encoding: [0x83,0xe2]
+
+
+bar:
+
+    ldi r24, lo8(bar)
+    ldi r24, hi8(bar)
+
+; CHECK: ldi  r24, lo8(bar)         ; encoding: [0x80'A',0xe0]
+; CHECK:                            ; fixup A - offset: 0, value: lo8(bar), kind: fixup_lo8_ldi
+; CHECK: ldi  r24, hi8(bar)         ; encoding: [0x80'A',0xe0]
+; CHECK:                            ; fixup A - offset: 0, value: hi8(bar), kind: fixup_hi8_ldi
+
+lo8:
+
+    ldi r24, lo8(0x0815)
+    ldi r24, lo8(foo)
+    ldi r24, lo8(bar + 5)
+
+; CHECK: ldi  r24, lo8(2069)        ; encoding: [0x85,0xe1]
+; CHECK: ldi  r24, lo8(foo)         ; encoding: [0x80'A',0xe0]
+; CHECK:                            ; fixup A - offset: 0, value: lo8(foo), kind: fixup_lo8_ldi
+; CHECK: ldi  r24, lo8(bar+5)       ; encoding: [0x80'A',0xe0]
+; CHECK:                            ; fixup A - offset: 0, value: lo8(bar+5), kind: fixup_lo8_ldi
+
+lo8_neg:
+
+    ldi r24, -lo8(123456)
+    ldi r24, -lo8(foo)
+
+; CHECK: ldi  r24, -lo8(123456)     ; encoding: [0x80,0xec]
+; CHECK: ldi  r24, -lo8(foo)        ; encoding: [0x80'A',0xe0]
+; CHECK:                            ; fixup A - offset: 0, value: -lo8(foo), kind: fixup_lo8_ldi_neg
+
+hi8:
+
+    ldi r24, hi8(0x0815)
+    ldi r24, hi8(foo)
+    ldi r24, hi8(bar + 5)
+
+; CHECK: ldi  r24, hi8(2069)        ; encoding: [0x88,0xe0]
+; CHECK: ldi  r24, hi8(foo)         ; encoding: [0x80'A',0xe0]
+; CHECK:                            ; fixup A - offset: 0, value: hi8(foo), kind: fixup_hi8_ldi
+; CHECK: ldi  r24, hi8(bar+5)       ; encoding: [0x80'A',0xe0]
+; CHECK:                            ; fixup A - offset: 0, value: hi8(bar+5), kind: fixup_hi8_ldi
+
+hi8_neg:
+
+    ldi r24, -hi8(123456)
+    ldi r24, -hi8(foo)
+
+; CHECK: ldi  r24, -hi8(123456)     ; encoding: [0x8d,0xe1]
+; CHECK: ldi  r24, -hi8(foo)        ; encoding: [0x80'A',0xe0]
+; CHECK:                            ; fixup A - offset: 0, value: -hi8(foo), kind: fixup_hi8_ldi_neg
+
+hh8:
+
+    ldi r24, hh8(0x0815)
+    ldi r24, hh8(foo)
+    ldi r24, hh8(bar + 5)
+
+; CHECK: ldi  r24, hh8(2069)        ; encoding: [0x80,0xe0]
+; CHECK: ldi  r24, hh8(foo)         ; encoding: [0x80'A',0xe0]
+; CHECK:                            ; fixup A - offset: 0, value: hh8(foo), kind: fixup_hh8_ldi
+; CHECK: ldi  r24, hh8(bar+5)       ; encoding: [0x80'A',0xe0]
+; CHECK:                            ; fixup A - offset: 0, value: hh8(bar+5), kind: fixup_hh8_ldi
+
+hh8_neg:
+
+    ldi r24, -hh8(123456)
+    ldi r24, -hh8(foo)
+
+; CHECK: ldi  r24, -hh8(123456)     ; encoding: [0x8e,0xef]
+; CHECK: ldi  r24, -hh8(foo)        ; encoding: [0x80'A',0xe0]
+; CHECK:                            ; fixup A - offset: 0, value: -hh8(foo), kind: fixup_hh8_ldi_neg
+
+hlo8: ; synonym with hh8() above, hence the... odd results
+
+    ldi r24, hlo8(0x0815)
+    ldi r24, hlo8(foo)
+    ldi r24, hlo8(bar + 5)
+
+; CHECK: ldi  r24, hh8(2069)        ; encoding: [0x80,0xe0]
+; CHECK: ldi  r24, hh8(foo)         ; encoding: [0x80'A',0xe0]
+; CHECK:                            ; fixup A - offset: 0, value: hh8(foo), kind: fixup_hh8_ldi
+; CHECK: ldi  r24, hh8(bar+5)       ; encoding: [0x80'A',0xe0]
+; CHECK:                            ; fixup A - offset: 0, value: hh8(bar+5), kind: fixup_hh8_ldi
+
+hlo8_neg:
+
+    ldi r24, -hlo8(123456)
+    ldi r24, -hlo8(foo)
+
+
+; CHECK: ldi  r24, -hh8(123456)    ; encoding: [0x8e,0xef]
+; CHECK: ldi  r24, -hh8(foo)       ; encoding: [0x80'A',0xe0]
+; CHECK:                           ; fixup A - offset: 0, value: -hh8(foo), kind: fixup_hh8_ldi_neg
+
+hhi8:
+
+    ldi r24, hhi8(0x0815)
+    ldi r24, hhi8(foo)
+    ldi r24, hhi8(bar + 5)
+
+; CHECK: ldi  r24, hhi8(2069)       ; encoding: [0x80,0xe0]
+; CHECK: ldi  r24, hhi8(foo)        ; encoding: [0x80'A',0xe0]
+; CHECK:                            ; fixup A - offset: 0, value: hhi8(foo), kind: fixup_ms8_ldi
+; CHECK: ldi  r24, hhi8(bar+5)      ; encoding: [0x80'A',0xe0]
+; CHECK:                            ; fixup A - offset: 0, value: hhi8(bar+5), kind: fixup_ms8_ldi
+
+hhi8_neg:
+    ldi r24, -hhi8(123456)
+    ldi r24, -hhi8(foo)
+
+
+; CHECK: ldi  r24, -hhi8(123456)    ; encoding: [0x8f,0xef]
+; CHECK: ldi  r24, -hhi8(foo)       ; encoding: [0x80'A',0xe0]
+; CHECK:                            ; fixup A - offset: 0, value: -hhi8(foo), kind: fixup_ms8_ldi_neg
+
+pm_lo8:
+    ldi r24, pm_lo8(0x0815)
+    ldi r24, pm_lo8(foo)
+    ldi r24, pm_lo8(bar + 5)
+
+; CHECK: ldi  r24, pm_lo8(2069)     ; encoding: [0x8a,0xe0]
+; CHECK: ldi  r24, pm_lo8(foo)      ; encoding: [0x80'A',0xe0]
+; CHECK:                            ; fixup A - offset: 0, value: pm_lo8(foo), kind: fixup_lo8_ldi_pm
+; CHECK: ldi  r24, pm_lo8(bar+5)    ; encoding: [0x80'A',0xe0]
+; CHECK:                            ; fixup A - offset: 0, value: pm_lo8(bar+5), kind: fixup_lo8_ldi_pm
+
+pm_hi8:
+    ldi r24, pm_hi8(0x0815)
+    ldi r24, pm_hi8(foo)
+    ldi r24, pm_hi8(bar + 5)
+
+; CHECK: ldi  r24, pm_hi8(2069)     ; encoding: [0x84,0xe0]
+; CHECK: ldi  r24, pm_hi8(foo)      ; encoding: [0x80'A',0xe0]
+; CHECK:                            ; fixup A - offset: 0, value: pm_hi8(foo), kind: fixup_hi8_ldi_pm
+; CHECK: ldi  r24, pm_hi8(bar+5)    ; encoding: [0x80'A',0xe0]
+; CHECK:                            ; fixup A - offset: 0, value: pm_hi8(bar+5), kind: fixup_hi8_ldi_pm
+
+pm_hh8:
+    ldi r24, pm_hh8(0x0815)
+    ldi r24, pm_hh8(foo)
+    ldi r24, pm_hh8(bar + 5)
+
+; CHECK: ldi  r24, pm_hh8(2069)     ; encoding: [0x80,0xe0]
+; CHECK: ldi  r24, pm_hh8(foo)      ; encoding: [0x80'A',0xe0]
+; CHECK:                            ; fixup A - offset: 0, value: pm_hh8(foo), kind: fixup_hh8_ldi_pm
+; CHECK: ldi  r24, pm_hh8(bar+5)    ; encoding: [0x80'A',0xe0]
+; CHECK:                            ; fixup A - offset: 0, value: pm_hh8(bar+5), kind: fixup_hh8_ldi_pm
+
+
+pm_lo8_neg:
+    ldi r24, -pm_lo8(0x0815)
+    ldi r24, -pm_lo8(foo)
+    ldi r24, -pm_lo8(bar + 5)
+
+; CHECK: ldi  r24, -pm_lo8(2069)     ; encoding: [0x85,0xef]
+; CHECK: ldi  r24, -pm_lo8(foo)      ; encoding: [0x80'A',0xe0]
+; CHECK:                             ; fixup A - offset: 0, value: -pm_lo8(foo), kind: fixup_lo8_ldi_pm_neg
+; CHECK: ldi  r24, -pm_lo8(bar+5)    ; encoding: [0x80'A',0xe0]
+; CHECK:                             ; fixup A - offset: 0, value: -pm_lo8(bar+5), kind: fixup_lo8_ldi_pm_neg
+
+pm_hi8_neg:
+    ldi r24, -pm_hi8(0x0815)
+    ldi r24, -pm_hi8(foo)
+    ldi r24, -pm_hi8(bar + 5)
+
+; CHECK: ldi  r24, -pm_hi8(2069)     ; encoding: [0x8b,0xef]
+; CHECK: ldi  r24, -pm_hi8(foo)      ; encoding: [0x80'A',0xe0]
+; CHECK:                             ; fixup A - offset: 0, value: -pm_hi8(foo), kind: fixup_hi8_ldi_pm_neg
+; CHECK: ldi  r24, -pm_hi8(bar+5)    ; encoding: [0x80'A',0xe0]
+; CHECK:                             ; fixup A - offset: 0, value: -pm_hi8(bar+5), kind: fixup_hi8_ldi_pm_neg
+
+pm_hh8_neg:
+    ldi r24, -pm_hh8(0x0815)
+    ldi r24, -pm_hh8(foo)
+    ldi r24, -pm_hh8(bar + 5)
+
+; CHECK: ldi  r24, -pm_hh8(2069)     ; encoding: [0x8f,0xef]
+; CHECK: ldi  r24, -pm_hh8(foo)      ; encoding: [0x80'A',0xe0]
+; CHECK:                             ; fixup A - offset: 0, value: -pm_hh8(foo), kind: fixup_hh8_ldi_pm_neg
+; CHECK: ldi  r24, -pm_hh8(bar+5)    ; encoding: [0x80'A',0xe0]
+; CHECK:                             ; fixup A - offset: 0, value: -pm_hh8(bar+5), kind: fixup_hh8_ldi_pm_neg
+

Added: llvm/trunk/test/MC/AVR/out-of-range-fixups/adiw-fail.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/out-of-range-fixups/adiw-fail.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/out-of-range-fixups/adiw-fail.s (added)
+++ llvm/trunk/test/MC/AVR/out-of-range-fixups/adiw-fail.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,5 @@
+; RUN: not llvm-mc -triple avr -mattr=avr6 -filetype=obj < %s 2>&1 | FileCheck %s
+
+; CHECK: error: out of range immediate (expected an integer in the range 0 to 63)
+adiw r24, foo+64
+

Added: llvm/trunk/test/MC/AVR/out-of-range-fixups/adiw-pass.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/out-of-range-fixups/adiw-pass.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/out-of-range-fixups/adiw-pass.s (added)
+++ llvm/trunk/test/MC/AVR/out-of-range-fixups/adiw-pass.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,5 @@
+; RUN: llvm-mc -triple avr -mattr=avr6 -filetype=obj < %s | llvm-objdump -r - | FileCheck %s
+
+; CHECK: R_AVR_6_ADIW foo+63
+adiw r24, foo+63
+

Added: llvm/trunk/test/MC/AVR/out-of-range-fixups/brbs-pass.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/out-of-range-fixups/brbs-pass.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/out-of-range-fixups/brbs-pass.s (added)
+++ llvm/trunk/test/MC/AVR/out-of-range-fixups/brbs-pass.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,5 @@
+; RUN: llvm-mc -triple avr -mattr=avr6 -filetype=obj < %s | llvm-objdump -r - | FileCheck %s
+
+; CHECK: R_AVR_7_PCREL foo+127
+brbs 1, foo+127
+

Added: llvm/trunk/test/MC/AVR/out-of-range-fixups/call-pass.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/out-of-range-fixups/call-pass.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/out-of-range-fixups/call-pass.s (added)
+++ llvm/trunk/test/MC/AVR/out-of-range-fixups/call-pass.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,5 @@
+; RUN: llvm-mc -triple avr -mattr=avr6 -filetype=obj < %s 2>&1 | llvm-objdump -r - | FileCheck %s
+
+; CHECK: R_AVR_CALL foo+8388607
+jmp foo+8388607
+

Added: llvm/trunk/test/MC/AVR/out-of-range-fixups/in-fail.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/out-of-range-fixups/in-fail.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/out-of-range-fixups/in-fail.s (added)
+++ llvm/trunk/test/MC/AVR/out-of-range-fixups/in-fail.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,5 @@
+; RUN: not llvm-mc -triple avr -mattr=avr6 -filetype=obj < %s 2>&1 | FileCheck %s
+
+; CHECK: error: out of range port number (expected an integer in the range 0 to 63)
+in r3, foo+64
+

Added: llvm/trunk/test/MC/AVR/out-of-range-fixups/in-pass.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/out-of-range-fixups/in-pass.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/out-of-range-fixups/in-pass.s (added)
+++ llvm/trunk/test/MC/AVR/out-of-range-fixups/in-pass.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,5 @@
+; RUN: llvm-mc -triple avr -mattr=avr6 -filetype=obj < %s | llvm-objdump -r - | FileCheck %s
+
+; CHECK: R_AVR_PORT6 foo+63
+in r3, foo+63
+

Added: llvm/trunk/test/MC/AVR/out-of-range-fixups/lds-fail.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/out-of-range-fixups/lds-fail.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/out-of-range-fixups/lds-fail.s (added)
+++ llvm/trunk/test/MC/AVR/out-of-range-fixups/lds-fail.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,5 @@
+; RUN: not llvm-mc -triple avr -mattr=avr6 -filetype=obj < %s 2>&1 | FileCheck %s
+
+; CHECK: error: out of range port number (expected an integer in the range 0 to 65535)
+lds r2, foo+65536
+

Added: llvm/trunk/test/MC/AVR/out-of-range-fixups/lds-pass.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/out-of-range-fixups/lds-pass.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/out-of-range-fixups/lds-pass.s (added)
+++ llvm/trunk/test/MC/AVR/out-of-range-fixups/lds-pass.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,5 @@
+; RUN: llvm-mc -triple avr -mattr=avr6 -filetype=obj < %s | llvm-objdump -r - | FileCheck %s
+
+; CHECK: R_AVR_16 foo+65535
+lds r2, foo+65535
+

Added: llvm/trunk/test/MC/AVR/out-of-range-fixups/rjmp-pass.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/out-of-range-fixups/rjmp-pass.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/out-of-range-fixups/rjmp-pass.s (added)
+++ llvm/trunk/test/MC/AVR/out-of-range-fixups/rjmp-pass.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,5 @@
+; RUN: llvm-mc -triple avr -mattr=avr6 -filetype=obj < %s | llvm-objdump -r - | FileCheck %s
+
+; CHECK: R_AVR_13_PCREL foo+4095
+rjmp foo+4095
+

Added: llvm/trunk/test/MC/AVR/out-of-range-fixups/sbi-fail.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/out-of-range-fixups/sbi-fail.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/out-of-range-fixups/sbi-fail.s (added)
+++ llvm/trunk/test/MC/AVR/out-of-range-fixups/sbi-fail.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,5 @@
+; RUN: not llvm-mc -triple avr -mattr=avr6 -filetype=obj < %s 2>&1 | FileCheck %s
+
+; CHECK: error: out of range port number (expected an integer in the range 0 to 31)
+sbi foo+32, 1
+

Added: llvm/trunk/test/MC/AVR/out-of-range-fixups/sbi-pass.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/out-of-range-fixups/sbi-pass.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/out-of-range-fixups/sbi-pass.s (added)
+++ llvm/trunk/test/MC/AVR/out-of-range-fixups/sbi-pass.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,5 @@
+; RUN: llvm-mc -triple avr -mattr=avr6 -filetype=obj < %s | llvm-objdump -r - | FileCheck %s
+
+; CHECK: R_AVR_PORT5 foo+31
+sbi foo+31, 1
+

Added: llvm/trunk/test/MC/AVR/relocations.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/relocations.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/relocations.s (added)
+++ llvm/trunk/test/MC/AVR/relocations.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,75 @@
+; RUN: llvm-mc -filetype=obj -triple=avr %s -mattr=avr6 | llvm-objdump -r - | FileCheck %s
+
+; CHECK: RELOCATION RECORDS FOR
+
+; CHECK-NEXT: R_AVR_LDI SYMBOL+3
+ldi r21, SYMBOL+3
+
+; CHECK-NEXT: R_AVR_6_ADIW FOO
+adiw r24, FOO
+
+; CHECK-NEXT: R_AVR_16 BAR+2
+lds r8, BAR+2
+
+; CHECK-NEXT: R_AVR_PORT5 foo
+sbic foo, 1
+
+; CHECK-NEXT: R_AVR_PORT6 Bar+2
+in r30, Bar+2
+
+; CHECK-NEXT: R_AVR_CALL foo+3
+call foo+3
+
+; CHECK-NEXT: R_AVR_13_PCREL foo-10
+rjmp foo-10
+
+; CHECK-NEXT: R_AVR_7_PCREL foo+2
+brcs foo+2
+
+; CHECK-NEXT: R_AVR_LO8_LDI bar+3
+ldi r24, lo8(bar+3)
+
+; CHECK-NEXT: R_AVR_HI8_LDI abc
+ldi r30, hi8(abc)
+
+; CHECK-NEXT: R_AVR_LO8_LDI_NEG abc
+ldi r16, -lo8(abc)
+
+; CHECK-NEXT: R_AVR_HI8_LDI_NEG abc
+ldi r16, -hi8(abc)
+
+; CHECK-NEXT: R_AVR_HH8_LDI foo
+ldi r16, hh8(foo)
+
+; CHECK-NEXT: R_AVR_HH8_LDI_NEG foo
+ldi r16, -hh8(foo)
+
+; CHECK-NEXT: R_AVR_HH8_LDI foo
+ldi r24, hlo8(foo)
+
+; CHECK-NEXT: R_AVR_HH8_LDI_NEG foo
+ldi r24, -hlo8(foo)
+
+; CHECK-NEXT: R_AVR_MS8_LDI bar
+ldi r24, hhi8(bar)
+
+; CHECK-NEXT: R_AVR_MS8_LDI_NEG bar
+ldi r24, -hhi8(bar)
+
+; CHECK-NEXT: R_AVR_LO8_LDI_PM foo
+ldi r17, pm_lo8(foo)
+
+; CHECK-NEXT: R_AVR_HI8_LDI_PM bar
+ldi r22, pm_hi8(bar)
+
+; CHECK-NEXT: R_AVR_HH8_LDI_PM baz
+ldi r25, pm_hh8(baz)
+
+; CHECK-NEXT: R_AVR_LO8_LDI_PM_NEG
+ldi r25, -pm_lo8(foo)
+
+; CHECK-NEXT: R_AVR_HI8_LDI_PM_NEG
+ldi r25, -pm_hi8(foo)
+
+; CHECK-NEXT: R_AVR_HH8_LDI_PM_NEG
+ldi r25, -pm_hh8(foo)

Added: llvm/trunk/test/MC/AVR/symbol_relocation.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/symbol_relocation.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/symbol_relocation.s (added)
+++ llvm/trunk/test/MC/AVR/symbol_relocation.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,16 @@
+; RUN: llvm-mc -filetype=obj -triple=avr %s -mattr=avr6 | llvm-objdump -r - | FileCheck %s
+
+; Checks that a global symbol with the address of another
+; symbol generates a R_AVR_16_PM relocation, as the symbol
+; will always be in program memory.
+
+; CHECK: RELOCATION RECORDS FOR [.rela.text]:
+; CHECK-NEXT: 00000002 R_AVR_16_PM .text
+
+foo:
+	ret
+
+.globl	ptr
+ptr:
+	.short	foo
+

Added: llvm/trunk/test/MC/AVR/syntax-reg-int-literal.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/syntax-reg-int-literal.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/syntax-reg-int-literal.s (added)
+++ llvm/trunk/test/MC/AVR/syntax-reg-int-literal.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,15 @@
+; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
+
+foo:
+  add 0,   15
+  add 15,  r0
+  add 16,  31
+  add r16, r31
+  add 31,  r16
+
+
+; CHECK: add r0,  r15               ; encoding: [0x0f,0x0c]
+; CHECK: add r15, r0                ; encoding: [0xf0,0x0c]
+; CHECK: add r16, r31               ; encoding: [0x0f,0x0f]
+; CHECK: add r16, r31               ; encoding: [0x0f,0x0f]
+; CHECK: add r31, r16               ; encoding: [0xf0,0x0f]

Added: llvm/trunk/test/MC/AVR/syntax-reg-pair.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AVR/syntax-reg-pair.s?rev=286417&view=auto
==============================================================================
--- llvm/trunk/test/MC/AVR/syntax-reg-pair.s (added)
+++ llvm/trunk/test/MC/AVR/syntax-reg-pair.s Wed Nov  9 17:46:25 2016
@@ -0,0 +1,13 @@
+; RUN: llvm-mc -triple avr -mattr=addsubiw -show-encoding < %s | FileCheck %s
+
+foo:
+
+  sbiw r24,     1
+  sbiw r25:r24, 2
+  sbiw r24,     2
+  sbiw r27:r26, 3
+
+; CHECK: sbiw r24,  1                  ; encoding: [0x01,0x97]
+; CHECK: sbiw r24,  2                  ; encoding: [0x02,0x97]
+; CHECK: sbiw r24,  2                  ; encoding: [0x02,0x97]
+; CHECK: sbiw r26,  3                  ; encoding: [0x13,0x97]




More information about the llvm-commits mailing list