Skip to content

Commit d91ab62

Browse files
committed
Update of rregression tests for clang-12
1 parent a6796e6 commit d91ab62

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

regression-tests/mixed-inspect-values-2.cpp2

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ constexpr auto empty = [](auto&& x){
1616
return std::empty(x);
1717
};
1818

19+
auto negative(auto v) {
20+
return v < 0;
21+
}
22+
1923
main: () -> int = {
2024
i := 15;
2125

@@ -33,6 +37,12 @@ main: () -> int = {
3337
std::cout << "i is between 10 and 30" << std::endl;
3438
}
3539

40+
if i is (negative) {
41+
std::cout << "i is negative" << std::endl;
42+
} else {
43+
std::cout << "i is not negative" << std::endl;
44+
}
45+
3646
v : std::vector<int> = ();
3747

3848
if empty(v) {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
i is between 11 and 20
22
less than 20
33
i is between 10 and 30
4+
i is not negative
45
v is empty
56
v is empty

regression-tests/test-results/mixed-inspect-values-2.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,18 @@ constexpr auto empty = [](auto&& x){
2727
return std::empty(x);
2828
};
2929

30-
#line 19 "mixed-inspect-values-2.cpp2"
30+
auto negative(auto v) {
31+
return v < 0;
32+
}
33+
34+
#line 23 "mixed-inspect-values-2.cpp2"
3135
[[nodiscard]] auto main() -> int;
3236

3337

3438
//=== Cpp2 function definitions =================================================
3539

3640

37-
#line 19 "mixed-inspect-values-2.cpp2"
41+
#line 23 "mixed-inspect-values-2.cpp2"
3842
[[nodiscard]] auto main() -> int{
3943
auto i {15};
4044

@@ -48,10 +52,16 @@ constexpr auto empty = [](auto&& x){
4852
std::cout << "less than 20" << std::endl;
4953
}
5054

51-
if (cpp2::is(std::move(i), (in(10, 30)))) {
55+
if (cpp2::is(i, (in(10, 30)))) {
5256
std::cout << "i is between 10 and 30" << std::endl;
5357
}
5458

59+
if (cpp2::is(std::move(i), (negative))) {
60+
std::cout << "i is negative" << std::endl;
61+
}else {
62+
std::cout << "i is not negative" << std::endl;
63+
}
64+
5565
std::vector<int> v {};
5666

5767
if (empty(v)) {

0 commit comments

Comments
 (0)