// NOTE: File has been autogenerated by utils/aarch64_builtins_test_generator.py
// RUN: %clang_cc1 %s -fsyntax-only -triple aarch64-none-linux-gnu -target-feature +lut -target-feature +sme -target-feature +sve -target-feature +sve2 -verify=guard
// RUN: %clang_cc1 %s -fsyntax-only -triple aarch64-none-linux-gnu -target-feature +lut -target-feature +sme -target-feature +sme2 -target-feature +sve -verify
// expected-no-diagnostics

// REQUIRES: aarch64-registered-target

#include <arm_sve.h>

// Properties: guard="sve,(sve2|sme2),lut" streaming_guard="sme,sme2,lut" flags="feature-dependent"

void test(void) {
  svbfloat16_t svbfloat16_t_val;
  svbfloat16x2_t svbfloat16x2_t_val;
  svfloat16_t svfloat16_t_val;
  svfloat16x2_t svfloat16x2_t_val;
  svint8_t svint8_t_val;
  svint16_t svint16_t_val;
  svint16x2_t svint16x2_t_val;
  svuint8_t svuint8_t_val;
  svuint16_t svuint16_t_val;
  svuint16x2_t svuint16x2_t_val;

  svluti2_lane(svbfloat16_t_val, svuint8_t_val, 2);
  svluti2_lane(svfloat16_t_val, svuint8_t_val, 2);
  svluti2_lane(svint8_t_val, svuint8_t_val, 2);
  svluti2_lane(svint16_t_val, svuint8_t_val, 2);
  svluti2_lane(svuint8_t_val, svuint8_t_val, 2);
  svluti2_lane(svuint16_t_val, svuint8_t_val, 2);
  svluti2_lane_bf16(svbfloat16_t_val, svuint8_t_val, 2);
  svluti2_lane_f16(svfloat16_t_val, svuint8_t_val, 2);
  svluti2_lane_s8(svint8_t_val, svuint8_t_val, 2);
  svluti2_lane_s16(svint16_t_val, svuint8_t_val, 2);
  svluti2_lane_u8(svuint8_t_val, svuint8_t_val, 2);
  svluti2_lane_u16(svuint16_t_val, svuint8_t_val, 2);
  svluti4_lane(svbfloat16_t_val, svuint8_t_val, 2);
  svluti4_lane(svbfloat16x2_t_val, svuint8_t_val, 2);
  svluti4_lane(svfloat16_t_val, svuint8_t_val, 2);
  svluti4_lane(svfloat16x2_t_val, svuint8_t_val, 2);
  svluti4_lane(svint8_t_val, svuint8_t_val, 1);
  svluti4_lane(svint16_t_val, svuint8_t_val, 2);
  svluti4_lane(svint16x2_t_val, svuint8_t_val, 2);
  svluti4_lane(svuint8_t_val, svuint8_t_val, 1);
  svluti4_lane(svuint16_t_val, svuint8_t_val, 2);
  svluti4_lane(svuint16x2_t_val, svuint8_t_val, 2);
  svluti4_lane_bf16(svbfloat16_t_val, svuint8_t_val, 2);
  svluti4_lane_bf16_x2(svbfloat16x2_t_val, svuint8_t_val, 2);
  svluti4_lane_f16(svfloat16_t_val, svuint8_t_val, 2);
  svluti4_lane_f16_x2(svfloat16x2_t_val, svuint8_t_val, 2);
  svluti4_lane_s8(svint8_t_val, svuint8_t_val, 1);
  svluti4_lane_s16(svint16_t_val, svuint8_t_val, 2);
  svluti4_lane_s16_x2(svint16x2_t_val, svuint8_t_val, 2);
  svluti4_lane_u8(svuint8_t_val, svuint8_t_val, 1);
  svluti4_lane_u16(svuint16_t_val, svuint8_t_val, 2);
  svluti4_lane_u16_x2(svuint16x2_t_val, svuint8_t_val, 2);
}

void test_streaming(void) __arm_streaming{
  svbfloat16_t svbfloat16_t_val;
  svbfloat16x2_t svbfloat16x2_t_val;
  svfloat16_t svfloat16_t_val;
  svfloat16x2_t svfloat16x2_t_val;
  svint8_t svint8_t_val;
  svint16_t svint16_t_val;
  svint16x2_t svint16x2_t_val;
  svuint8_t svuint8_t_val;
  svuint16_t svuint16_t_val;
  svuint16x2_t svuint16x2_t_val;

  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti2_lane(svbfloat16_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti2_lane(svfloat16_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti2_lane(svint8_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti2_lane(svint16_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti2_lane(svuint8_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti2_lane(svuint16_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti2_lane_bf16(svbfloat16_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti2_lane_f16(svfloat16_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti2_lane_s8(svint8_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti2_lane_s16(svint16_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti2_lane_u8(svuint8_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti2_lane_u16(svuint16_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti4_lane(svbfloat16_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti4_lane(svbfloat16x2_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti4_lane(svfloat16_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti4_lane(svfloat16x2_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti4_lane(svint8_t_val, svuint8_t_val, 1);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti4_lane(svint16_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti4_lane(svint16x2_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti4_lane(svuint8_t_val, svuint8_t_val, 1);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti4_lane(svuint16_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti4_lane(svuint16x2_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti4_lane_bf16(svbfloat16_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti4_lane_bf16_x2(svbfloat16x2_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti4_lane_f16(svfloat16_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti4_lane_f16_x2(svfloat16x2_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti4_lane_s8(svint8_t_val, svuint8_t_val, 1);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti4_lane_s16(svint16_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti4_lane_s16_x2(svint16x2_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti4_lane_u8(svuint8_t_val, svuint8_t_val, 1);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti4_lane_u16(svuint16_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti4_lane_u16_x2(svuint16x2_t_val, svuint8_t_val, 2);
}

void test_streaming_compatible(void) __arm_streaming_compatible{
  svbfloat16_t svbfloat16_t_val;
  svbfloat16x2_t svbfloat16x2_t_val;
  svfloat16_t svfloat16_t_val;
  svfloat16x2_t svfloat16x2_t_val;
  svint8_t svint8_t_val;
  svint16_t svint16_t_val;
  svint16x2_t svint16x2_t_val;
  svuint8_t svuint8_t_val;
  svuint16_t svuint16_t_val;
  svuint16x2_t svuint16x2_t_val;

  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti2_lane(svbfloat16_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti2_lane(svfloat16_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti2_lane(svint8_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti2_lane(svint16_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti2_lane(svuint8_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti2_lane(svuint16_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti2_lane_bf16(svbfloat16_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti2_lane_f16(svfloat16_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti2_lane_s8(svint8_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti2_lane_s16(svint16_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti2_lane_u8(svuint8_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti2_lane_u16(svuint16_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti4_lane(svbfloat16_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti4_lane(svbfloat16x2_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti4_lane(svfloat16_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti4_lane(svfloat16x2_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti4_lane(svint8_t_val, svuint8_t_val, 1);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti4_lane(svint16_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti4_lane(svint16x2_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti4_lane(svuint8_t_val, svuint8_t_val, 1);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti4_lane(svuint16_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti4_lane(svuint16x2_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti4_lane_bf16(svbfloat16_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti4_lane_bf16_x2(svbfloat16x2_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti4_lane_f16(svfloat16_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti4_lane_f16_x2(svfloat16x2_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti4_lane_s8(svint8_t_val, svuint8_t_val, 1);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti4_lane_s16(svint16_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti4_lane_s16_x2(svint16x2_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti4_lane_u8(svuint8_t_val, svuint8_t_val, 1);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti4_lane_u16(svuint16_t_val, svuint8_t_val, 2);
  // guard-error@+1 {{builtin can only be called from a non-streaming function}}
  svluti4_lane_u16_x2(svuint16x2_t_val, svuint8_t_val, 2);
}
