llvm/clang/test/CodeGen/aarch64-sme-intrinsics/acle_sme_cnt.c

// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 3
// REQUIRES: aarch64-registered-target
// RUN: %clang_cc1 -triple aarch64 -target-feature +sme -O1 -Werror -emit-llvm -o - %s | FileCheck %s -check-prefixes=CHECK,CHECK-C
// RUN: %clang_cc1 -triple aarch64 -target-feature +sme -O1 -Werror -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefixes=CHECK,CHECK-CXX
// RUN: %clang_cc1 -triple aarch64 -target-feature +sme -S -O1 -Werror -o /dev/null %s

#include <arm_sme.h>

// CHECK-C-LABEL: define dso_local i64 @test_svcntsb(
// CHECK-C-SAME: ) local_unnamed_addr #[[ATTR0:[0-9]+]] {
// CHECK-C-NEXT:  entry:
// CHECK-C-NEXT:    [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sme.cntsb()
// CHECK-C-NEXT:    ret i64 [[TMP0]]
//
// CHECK-CXX-LABEL: define dso_local noundef i64 @_Z12test_svcntsbv(
// CHECK-CXX-SAME: ) local_unnamed_addr #[[ATTR0:[0-9]+]] {
// CHECK-CXX-NEXT:  entry:
// CHECK-CXX-NEXT:    [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sme.cntsb()
// CHECK-CXX-NEXT:    ret i64 [[TMP0]]
//
uint64_t test_svcntsb() {
  return svcntsb();
}

// CHECK-C-LABEL: define dso_local i64 @test_svcntsh(
// CHECK-C-SAME: ) local_unnamed_addr #[[ATTR0]] {
// CHECK-C-NEXT:  entry:
// CHECK-C-NEXT:    [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sme.cntsh()
// CHECK-C-NEXT:    ret i64 [[TMP0]]
//
// CHECK-CXX-LABEL: define dso_local noundef i64 @_Z12test_svcntshv(
// CHECK-CXX-SAME: ) local_unnamed_addr #[[ATTR0]] {
// CHECK-CXX-NEXT:  entry:
// CHECK-CXX-NEXT:    [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sme.cntsh()
// CHECK-CXX-NEXT:    ret i64 [[TMP0]]
//
uint64_t test_svcntsh() {
  return svcntsh();
}

// CHECK-C-LABEL: define dso_local i64 @test_svcntsw(
// CHECK-C-SAME: ) local_unnamed_addr #[[ATTR0]] {
// CHECK-C-NEXT:  entry:
// CHECK-C-NEXT:    [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sme.cntsw()
// CHECK-C-NEXT:    ret i64 [[TMP0]]
//
// CHECK-CXX-LABEL: define dso_local noundef i64 @_Z12test_svcntswv(
// CHECK-CXX-SAME: ) local_unnamed_addr #[[ATTR0]] {
// CHECK-CXX-NEXT:  entry:
// CHECK-CXX-NEXT:    [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sme.cntsw()
// CHECK-CXX-NEXT:    ret i64 [[TMP0]]
//
uint64_t test_svcntsw() {
  return svcntsw();
}

// CHECK-C-LABEL: define dso_local i64 @test_svcntsd(
// CHECK-C-SAME: ) local_unnamed_addr #[[ATTR0]] {
// CHECK-C-NEXT:  entry:
// CHECK-C-NEXT:    [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sme.cntsd()
// CHECK-C-NEXT:    ret i64 [[TMP0]]
//
// CHECK-CXX-LABEL: define dso_local noundef i64 @_Z12test_svcntsdv(
// CHECK-CXX-SAME: ) local_unnamed_addr #[[ATTR0]] {
// CHECK-CXX-NEXT:  entry:
// CHECK-CXX-NEXT:    [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sme.cntsd()
// CHECK-CXX-NEXT:    ret i64 [[TMP0]]
//
uint64_t test_svcntsd() {
  return svcntsd();
}
//// NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
// CHECK: {{.*}}