xref: /llvm-project/llvm/test/Other/scalable-vector-struct-intrinsic.ll (revision 34c4fae4b296038bbfda5b37c4eb06d5a2c0650b)
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2; RUN: opt -S -passes=verify < %s 2>&1 | FileCheck %s
3
4; Make sure we allow scalable vectors in structs for returning multiple
5; values from intrinsics.
6
7declare { <vscale x 2 x i32>, <vscale x 2 x i1> } @llvm.sadd.with.overflow.nxv2i32(<vscale x 2 x i32>, <vscale x 2 x i32>)
8
9define <vscale x 2 x i32> @foo(<vscale x 2 x i32> %x, <vscale x 2 x i32> %y) {
10; CHECK-LABEL: @foo(
11; CHECK-NEXT:    [[A:%.*]] = call { <vscale x 2 x i32>, <vscale x 2 x i1> } @llvm.sadd.with.overflow.nxv2i32(<vscale x 2 x i32> [[X:%.*]], <vscale x 2 x i32> [[Y:%.*]])
12; CHECK-NEXT:    [[B:%.*]] = extractvalue { <vscale x 2 x i32>, <vscale x 2 x i1> } [[A]], 0
13; CHECK-NEXT:    ret <vscale x 2 x i32> [[B]]
14;
15  %a = call { <vscale x 2 x i32>, <vscale x 2 x i1> } @llvm.sadd.with.overflow.nxv2i32(<vscale x 2 x i32> %x, <vscale x 2 x i32> %y)
16  %b = extractvalue { <vscale x 2 x i32>, <vscale x 2 x i1> } %a, 0
17  ret <vscale x 2 x i32> %b
18}
19