[llvm] r327967 - [AVR] Add a regression test for struct return lowering

Dylan McKay via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 20 04:23:04 PDT 2018


Author: dylanmckay
Date: Tue Mar 20 04:23:03 2018
New Revision: 327967

URL: http://llvm.org/viewvc/llvm-project?rev=327967&view=rev
Log:
[AVR] Add a regression test for struct return lowering

The test is taken from
https://github.com/avr-rust/rust/issues/57

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

Patch by Peter Nimmervoll

Added:
    llvm/trunk/test/CodeGen/AVR/lower-formal-args-struct-return.ll

Added: llvm/trunk/test/CodeGen/AVR/lower-formal-args-struct-return.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AVR/lower-formal-args-struct-return.ll?rev=327967&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/AVR/lower-formal-args-struct-return.ll (added)
+++ llvm/trunk/test/CodeGen/AVR/lower-formal-args-struct-return.ll Tue Mar 20 04:23:03 2018
@@ -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
+}
+




More information about the llvm-commits mailing list