1*207e5cccSFangrui Song // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py 2*207e5cccSFangrui Song // REQUIRES: aarch64-registered-target 3*207e5cccSFangrui Song // RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sve -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s 4*207e5cccSFangrui Song // RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sve -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK 5*207e5cccSFangrui Song // RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sve -S -disable-O0-optnone -Werror -Wall -o /dev/null %s 6*207e5cccSFangrui Song // RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sme -S -disable-O0-optnone -Werror -Wall -o /dev/null %s 7*207e5cccSFangrui Song 8*207e5cccSFangrui Song #include <arm_sve.h> 9*207e5cccSFangrui Song 10*207e5cccSFangrui Song #if defined __ARM_FEATURE_SME 11*207e5cccSFangrui Song #define MODE_ATTR __arm_streaming 12*207e5cccSFangrui Song #else 13*207e5cccSFangrui Song #define MODE_ATTR 14*207e5cccSFangrui Song #endif 15*207e5cccSFangrui Song 16*207e5cccSFangrui Song // CHECK-LABEL: @test_svptest_any( 17*207e5cccSFangrui Song // CHECK-NEXT: entry: 18*207e5cccSFangrui Song // CHECK-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.aarch64.sve.ptest.any.nxv16i1(<vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i1> [[OP:%.*]]) 19*207e5cccSFangrui Song // CHECK-NEXT: ret i1 [[TMP0]] 20*207e5cccSFangrui Song // 21*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z16test_svptest_anyu10__SVBool_tS_( 22*207e5cccSFangrui Song // CPP-CHECK-NEXT: entry: 23*207e5cccSFangrui Song // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.aarch64.sve.ptest.any.nxv16i1(<vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i1> [[OP:%.*]]) 24*207e5cccSFangrui Song // CPP-CHECK-NEXT: ret i1 [[TMP0]] 25*207e5cccSFangrui Song // 26*207e5cccSFangrui Song bool test_svptest_any(svbool_t pg, svbool_t op) MODE_ATTR 27*207e5cccSFangrui Song { 28*207e5cccSFangrui Song return svptest_any(pg, op); 29*207e5cccSFangrui Song } 30*207e5cccSFangrui Song 31*207e5cccSFangrui Song // CHECK-LABEL: @test_svptest_first( 32*207e5cccSFangrui Song // CHECK-NEXT: entry: 33*207e5cccSFangrui Song // CHECK-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.aarch64.sve.ptest.first.nxv16i1(<vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i1> [[OP:%.*]]) 34*207e5cccSFangrui Song // CHECK-NEXT: ret i1 [[TMP0]] 35*207e5cccSFangrui Song // 36*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z18test_svptest_firstu10__SVBool_tS_( 37*207e5cccSFangrui Song // CPP-CHECK-NEXT: entry: 38*207e5cccSFangrui Song // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.aarch64.sve.ptest.first.nxv16i1(<vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i1> [[OP:%.*]]) 39*207e5cccSFangrui Song // CPP-CHECK-NEXT: ret i1 [[TMP0]] 40*207e5cccSFangrui Song // 41*207e5cccSFangrui Song bool test_svptest_first(svbool_t pg, svbool_t op) MODE_ATTR 42*207e5cccSFangrui Song { 43*207e5cccSFangrui Song return svptest_first(pg, op); 44*207e5cccSFangrui Song } 45*207e5cccSFangrui Song 46*207e5cccSFangrui Song // CHECK-LABEL: @test_svptest_last( 47*207e5cccSFangrui Song // CHECK-NEXT: entry: 48*207e5cccSFangrui Song // CHECK-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.aarch64.sve.ptest.last.nxv16i1(<vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i1> [[OP:%.*]]) 49*207e5cccSFangrui Song // CHECK-NEXT: ret i1 [[TMP0]] 50*207e5cccSFangrui Song // 51*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z17test_svptest_lastu10__SVBool_tS_( 52*207e5cccSFangrui Song // CPP-CHECK-NEXT: entry: 53*207e5cccSFangrui Song // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.aarch64.sve.ptest.last.nxv16i1(<vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i1> [[OP:%.*]]) 54*207e5cccSFangrui Song // CPP-CHECK-NEXT: ret i1 [[TMP0]] 55*207e5cccSFangrui Song // 56*207e5cccSFangrui Song bool test_svptest_last(svbool_t pg, svbool_t op) MODE_ATTR 57*207e5cccSFangrui Song { 58*207e5cccSFangrui Song return svptest_last(pg, op); 59*207e5cccSFangrui Song } 60