1a8e1175bSopenharmony_ci/*
2a8e1175bSopenharmony_ci *  Simple program to test that Mbed TLS builds correctly as a CMake package.
3a8e1175bSopenharmony_ci *
4a8e1175bSopenharmony_ci *  Copyright The Mbed TLS Contributors
5a8e1175bSopenharmony_ci *  SPDX-License-Identifier: Apache-2.0
6a8e1175bSopenharmony_ci *
7a8e1175bSopenharmony_ci *  Licensed under the Apache License, Version 2.0 (the "License"); you may
8a8e1175bSopenharmony_ci *  not use this file except in compliance with the License.
9a8e1175bSopenharmony_ci *  You may obtain a copy of the License at
10a8e1175bSopenharmony_ci *
11a8e1175bSopenharmony_ci *  http://www.apache.org/licenses/LICENSE-2.0
12a8e1175bSopenharmony_ci *
13a8e1175bSopenharmony_ci *  Unless required by applicable law or agreed to in writing, software
14a8e1175bSopenharmony_ci *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15a8e1175bSopenharmony_ci *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16a8e1175bSopenharmony_ci *  See the License for the specific language governing permissions and
17a8e1175bSopenharmony_ci *  limitations under the License.
18a8e1175bSopenharmony_ci */
19a8e1175bSopenharmony_ci
20a8e1175bSopenharmony_ci#include "mbedtls/build_info.h"
21a8e1175bSopenharmony_ci
22a8e1175bSopenharmony_ci#include "mbedtls/platform.h"
23a8e1175bSopenharmony_ci
24a8e1175bSopenharmony_ci#include "mbedtls/version.h"
25a8e1175bSopenharmony_ci
26a8e1175bSopenharmony_ci/* The main reason to build this is for testing the CMake build, so the program
27a8e1175bSopenharmony_ci * doesn't need to do very much. It calls a single library function to ensure
28a8e1175bSopenharmony_ci * linkage works, but that is all. */
29a8e1175bSopenharmony_ciint main()
30a8e1175bSopenharmony_ci{
31a8e1175bSopenharmony_ci    /* This version string is 18 bytes long, as advised by version.h. */
32a8e1175bSopenharmony_ci    char version[18];
33a8e1175bSopenharmony_ci
34a8e1175bSopenharmony_ci    mbedtls_version_get_string_full(version);
35a8e1175bSopenharmony_ci
36a8e1175bSopenharmony_ci    mbedtls_printf("Built against %s\n", version);
37a8e1175bSopenharmony_ci
38a8e1175bSopenharmony_ci    return 0;
39a8e1175bSopenharmony_ci}
40