[ARM] Masked load and store and predicate tests. NFC
[llvm-complete.git] / unittests / Support / VersionTupleTest.cpp
blobaf6c0a7febad50f5a6e214e158bd2c2b35c0f5c5
1 //===- VersionTupleTests.cpp - Version Number Handling Tests --------------===//
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 //===----------------------------------------------------------------------===//
9 #include "llvm/Support/VersionTuple.h"
10 #include "gtest/gtest.h"
12 using namespace llvm;
14 TEST(VersionTuple, getAsString) {
15 EXPECT_EQ("0", VersionTuple().getAsString());
16 EXPECT_EQ("1", VersionTuple(1).getAsString());
17 EXPECT_EQ("1.2", VersionTuple(1, 2).getAsString());
18 EXPECT_EQ("1.2.3", VersionTuple(1, 2, 3).getAsString());
19 EXPECT_EQ("1.2.3.4", VersionTuple(1, 2, 3, 4).getAsString());
22 TEST(VersionTuple, tryParse) {
23 VersionTuple VT;
25 EXPECT_FALSE(VT.tryParse("1"));
26 EXPECT_EQ("1", VT.getAsString());
28 EXPECT_FALSE(VT.tryParse("1.2"));
29 EXPECT_EQ("1.2", VT.getAsString());
31 EXPECT_FALSE(VT.tryParse("1.2.3"));
32 EXPECT_EQ("1.2.3", VT.getAsString());
34 EXPECT_FALSE(VT.tryParse("1.2.3.4"));
35 EXPECT_EQ("1.2.3.4", VT.getAsString());
37 EXPECT_TRUE(VT.tryParse(""));
38 EXPECT_TRUE(VT.tryParse("1."));
39 EXPECT_TRUE(VT.tryParse("1.2."));
40 EXPECT_TRUE(VT.tryParse("1.2.3."));
41 EXPECT_TRUE(VT.tryParse("1.2.3.4."));
42 EXPECT_TRUE(VT.tryParse("1.2.3.4.5"));
43 EXPECT_TRUE(VT.tryParse("1-2"));
44 EXPECT_TRUE(VT.tryParse("1+2"));
45 EXPECT_TRUE(VT.tryParse(".1"));
46 EXPECT_TRUE(VT.tryParse(" 1"));
47 EXPECT_TRUE(VT.tryParse("1 "));
48 EXPECT_TRUE(VT.tryParse("."));