// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5

// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library %s -emit-llvm -o - | FileCheck %s

typedef _Float16 half;
typedef half half2 __attribute__((ext_vector_type(2)));

// CHECK-LABEL: define float @test_dot2add(
// CHECK-SAME: <2 x half> noundef [[X:%.*]], <2 x half> noundef [[Y:%.*]], float noundef [[Z:%.*]]) #[[ATTR0:[0-9]+]] {
// CHECK-NEXT:  [[ENTRY:.*:]]
// CHECK-NEXT:    [[X_ADDR:%.*]] = alloca <2 x half>, align 4
// CHECK-NEXT:    [[Y_ADDR:%.*]] = alloca <2 x half>, align 4
// CHECK-NEXT:    [[Z_ADDR:%.*]] = alloca float, align 4
// CHECK-NEXT:    store <2 x half> [[X]], ptr [[X_ADDR]], align 4
// CHECK-NEXT:    store <2 x half> [[Y]], ptr [[Y_ADDR]], align 4
// CHECK-NEXT:    store float [[Z]], ptr [[Z_ADDR]], align 4
// CHECK-NEXT:    [[TMP0:%.*]] = load <2 x half>, ptr [[X_ADDR]], align 4
// CHECK-NEXT:    [[TMP1:%.*]] = load <2 x half>, ptr [[Y_ADDR]], align 4
// CHECK-NEXT:    [[TMP2:%.*]] = load float, ptr [[Z_ADDR]], align 4
// CHECK-NEXT:    [[TMP3:%.*]] = extractelement <2 x half> [[TMP0]], i32 0
// CHECK-NEXT:    [[TMP4:%.*]] = extractelement <2 x half> [[TMP0]], i32 1
// CHECK-NEXT:    [[TMP5:%.*]] = extractelement <2 x half> [[TMP1]], i32 0
// CHECK-NEXT:    [[TMP6:%.*]] = extractelement <2 x half> [[TMP1]], i32 1
// CHECK-NEXT:    [[DX_DOT2ADD:%.*]] = call float @llvm.dx.dot2add(float [[TMP2]], half [[TMP3]], half [[TMP4]], half [[TMP5]], half [[TMP6]])
// CHECK-NEXT:    ret float [[DX_DOT2ADD]]
//
float test_dot2add(half2 X, half2 Y, float Z) {
  return __builtin_dx_dot2add(X, Y, Z);
}
