Debian Codegraph @

crt/aws-c-common/tests/cpuid_test.c

raw symbols SCIP
1 /*
2 * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License").
5 * You may not use this file except in compliance with the License.
6 * A copy of the License is located at
7 *
8 * http://aws.amazon.com/apache2.0
9 *
10 * or in the "license" file accompanying this file. This file is distributed
11 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 * express or implied. See the License for the specific language governing
13 * permissions and limitations under the License.
14 */
15
16 #include <aws/common/cpuid.h>
17 #include <aws/testing/aws_test_harness.h>
18
19 static int s_cpuid_test_fn(struct aws_allocator *allocator, void *ctx) {
20 (void)allocator;
21 (void)ctx;
22 /* TODO: make sure those check returns the expected value. */
23 aws_cpu_has_feature(AWS_CPU_FEATURE_CLMUL);
24 aws_cpu_has_feature(AWS_CPU_FEATURE_SSE_4_1);
25 aws_cpu_has_feature(AWS_CPU_FEATURE_SSE_4_2);
26 aws_cpu_has_feature(AWS_CPU_FEATURE_AVX2);
27 aws_cpu_has_feature(AWS_CPU_FEATURE_AVX512);
28 aws_cpu_has_feature(AWS_CPU_FEATURE_ARM_CRC);
29 aws_cpu_has_feature(AWS_CPU_FEATURE_BMI2);
30 return AWS_OP_SUCCESS;
31 }
32
33 AWS_TEST_CASE(cpuid_test, s_cpuid_test_fn);