Skip to content
This repository was archived by the owner on Sep 2, 2018. It is now read-only.

Commit 8351752

Browse files
author
Dylan McKay
committed
Merge pull request #180 from shepmaster/i8-truncated-to-zero
1-bit types consume one byte of space, not zero
2 parents bf5a68a + 29f9ff0 commit 8351752

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

lib/Target/AVR/AVRISelLowering.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -835,8 +835,8 @@ bool AVRTargetLowering::isOffsetFoldingLegal(
835835
static void parseFunctionArgs(const Function *F, const DataLayout *TD,
836836
SmallVectorImpl<unsigned> &Out) {
837837
for (Argument const &Arg : F->args()) {
838-
unsigned Bytes = TD->getTypeSizeInBits(Arg.getType()) / 8;
839-
Out.push_back(((Bytes == 1) || (Bytes == 2)) ? 1 : Bytes / 2);
838+
unsigned Bytes = (TD->getTypeSizeInBits(Arg.getType()) + 7) / 8;
839+
Out.push_back((Bytes + 1) / 2);
840840
}
841841
}
842842

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
; RUN: llc < %s -march=avr | FileCheck %s
2-
; XFAIL:
3-
4-
; Test case for an assertion error.
5-
;
6-
; Error:
7-
; ```
8-
; "LowerFormalArguments didn't emit the correct number of values!"
9-
; ```
10-
; in `lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp`
112

123
define void @foo(i1) {
4+
; CHECK-LABEL: foo:
5+
; CHECK: ret
136
ret void
147
}

0 commit comments

Comments
 (0)