1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -passes=verify < %s 2>&1 | FileCheck %s
4 ; Make sure we allow scalable vectors in structs for returning multiple
5 ; values from intrinsics.
7 declare { <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>)
9 define <vscale x 2 x i32> @foo(<vscale x 2 x i32> %x, <vscale x 2 x i32> %y) {
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]]
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