1 | //===- llvm/unittest/IR/CoreBindings.cpp - Tests for C-API bindings -------===// |
2 | // |
3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | // See https://llvm.org/LICENSE.txt for license information. |
5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | |
9 | #include "llvm-c/Core.h" |
10 | #include "llvm/Config/llvm-config.h" |
11 | #include "gtest/gtest.h" |
12 | |
13 | namespace { |
14 | |
15 | TEST(CoreBindings, VersionTest) { |
16 | // Test ability to ignore output parameters |
17 | LLVMGetVersion(Major: nullptr, Minor: nullptr, Patch: nullptr); |
18 | |
19 | unsigned Major, Minor, Patch; |
20 | LLVMGetVersion(Major: &Major, Minor: &Minor, Patch: &Patch); |
21 | EXPECT_EQ(Major, (unsigned)LLVM_VERSION_MAJOR); |
22 | EXPECT_EQ(Minor, (unsigned)LLVM_VERSION_MINOR); |
23 | EXPECT_EQ(Patch, (unsigned)LLVM_VERSION_PATCH); |
24 | } |
25 | |
26 | } // end anonymous namespace |
27 | |