Skip to content
This repository has been archived by the owner on Jan 1, 2023. It is now read-only.

Commit

Permalink
[AVR] Add a regression test for struct return lowering
Browse files Browse the repository at this point in the history
The test is taken from
avr-rust/rust-legacy-fork#57

The originally implementation of struct return lowering was made in
r325474.

Patch by Peter Nimmervoll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327967 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
dylanmckay committed Mar 20, 2018
1 parent 112a581 commit c3f1f1e
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/CodeGen/AVR/lower-formal-args-struct-return.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
; RUN: llc < %s -march=avr | FileCheck %s

; This test ensures that the backend can lower returns of struct values.
; It does not check how these are lowered.
;
; In the past, this code used to return an error
;
; Assertion `InVals.size() == Ins.size() && "LowerFormalArguments didn't emit the correct number of values!"' failed.
;
; This feature was first implemented in r325474.

declare i8 @do_something(i8 %val)

; CHECK-LABEL: main
define { i1, i8 } @main(i8) #2 {
entry:
%1 = call zeroext i8 @do_something(i8 zeroext %0)
%2 = insertvalue { i1, i8 } { i1 true, i8 undef }, i8 %1, 1
ret { i1, i8 } %2
}

0 comments on commit c3f1f1e

Please sign in to comment.