forked from llvm-mirror/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Fixes PR 31345 Reviewers: dylanmckay Subscribers: fhahn, llvm-commits Differential Revision: https://reviews.llvm.org/D28186 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290778 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
Dylan McKay
committed
Dec 31, 2016
1 parent
67125e9
commit 3afd0d7
Showing
3 changed files
with
57 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
; RUN: llc < %s -march=avr | FileCheck %s | ||
|
||
; Unit test for: PR 31345 | ||
|
||
define i16 @and16_reg_imm_0xff00(i16 %a) { | ||
; CHECK-LABEL: and16_reg_imm_0xff00 | ||
; CHECK: andi {{r[0-9]+}}, 0 | ||
; CHECK-NOT: andi {{r[0-9]+}}, 255 | ||
%result = and i16 %a, 65280 | ||
ret i16 %result | ||
} | ||
|
||
define i16 @and16_reg_imm_0xffb3(i16 %a) { | ||
; CHECK-LABEL: and16_reg_imm_0xffb3 | ||
; CHECK: andi {{r[0-9]+}}, 179 | ||
; CHECK-NOT: andi {{r[0-9]+}}, 255 | ||
%result = and i16 %a, 65459 | ||
ret i16 %result | ||
} | ||
|
||
define i16 @and16_reg_imm_0x00ff(i16 %a) { | ||
; CHECK-LABEL: and16_reg_imm_0x00ff | ||
; CHECK-NOT: andi {{r[0-9]+}}, 255 | ||
; CHECK: andi {{r[0-9]+}}, 0 | ||
%result = and i16 %a, 255 | ||
ret i16 %result | ||
} | ||
|
||
define i16 @and16_reg_imm_0xb3ff(i16 %a) { | ||
; CHECK-LABEL: and16_reg_imm_0xb3ff | ||
; CHECK-NOT: andi {{r[0-9]+}}, 255 | ||
; CHECK: andi {{r[0-9]+}}, 179 | ||
%result = and i16 %a, 46079 | ||
ret i16 %result | ||
} | ||
|
||
define i16 @and16_reg_imm_0xffff(i16 %a) { | ||
; CHECK-LABEL: and16_reg_imm_0xffff | ||
; CHECK-NOT: andi {{r[0-9]+}}, 255 | ||
; CHECK-NOT: andi {{r[0-9]+}}, 255 | ||
%result = and i16 %a, 65535 | ||
ret i16 %result | ||
} | ||
|
||
define i16 @and16_reg_imm_0xabcd(i16 %a) { | ||
; CHECK-LABEL: and16_reg_imm_0xabcd | ||
; CHECK: andi {{r[0-9]+}}, 205 | ||
; CHECK: andi {{r[0-9]+}}, 171 | ||
%result = and i16 %a, 43981 | ||
ret i16 %result | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters