Skip to content

Commit bc46c88

Browse files
authored
Merge pull request #8328 from tautschnig/github-no-macos-11
Switch GitHub CI jobs from macos-11 to macos-13
2 parents 2a5151c + 4eadc8a commit bc46c88

File tree

22 files changed

+189
-22
lines changed

22 files changed

+189
-22
lines changed

.github/workflows/pull-request-checks.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -583,8 +583,8 @@ jobs:
583583
run: cd build; ctest . -V -L THOROUGH -j2
584584

585585
# This job takes approximately 39 to 69 minutes
586-
check-macos-11-make-clang:
587-
runs-on: macos-11
586+
check-macos-13-make-clang:
587+
runs-on: macos-13
588588
steps:
589589
- uses: actions/checkout@v4
590590
with:
@@ -617,8 +617,8 @@ jobs:
617617
- name: Build using Make
618618
run: |
619619
make -C src minisat2-download cadical-download
620-
make -C src -j3 CXX="ccache clang++" MINISAT2=../../minisat-2.2.1 CADICAL=../../cadical
621-
make -C jbmc/src -j3 CXX="ccache clang++"
620+
make -C src -j4 CXX="ccache clang++" MINISAT2=../../minisat-2.2.1 CADICAL=../../cadical
621+
make -C jbmc/src -j4 CXX="ccache clang++"
622622
make -C unit "CXX=ccache clang++"
623623
make -C jbmc/unit "CXX=ccache clang++"
624624
- name: Print ccache stats
@@ -630,9 +630,9 @@ jobs:
630630
- name: Run JBMC unit tests
631631
run: cd jbmc/unit; ./unit_tests
632632
- name: Run regression tests
633-
run: make -C regression test-parallel JOBS=3
633+
run: make -C regression test-parallel JOBS=4
634634
- name: Run JBMC regression tests
635-
run: make -C jbmc/regression test-parallel JOBS=3
635+
run: make -C jbmc/regression test-parallel JOBS=4
636636

637637
# This job takes approximately 66 to 85 minutes
638638
check-macos-12-cmake-clang:

.github/workflows/release-packages.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ jobs:
152152
SLACK_MESSAGE: "${{ job.status == 'success' && 'Ubuntu 20.04 package built and uploaded successfully' || 'Ubuntu 20.04 package build failed' }}"
153153

154154
homebrew-pr:
155-
runs-on: macos-11
155+
runs-on: macos-13
156156
steps:
157157
- name: Get release tag name
158158
# The GITHUB_REF we get has refs/tags/ in front of the tag name so we
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
CORE
1+
THOROUGH
22
Test
3-
--function Test.check --unwind 10 --no-unwinding-assertions --max-nondet-string-length 10 --java-assume-inputs-non-null
3+
--function Test.check --unwind 10 --no-unwinding-assertions --max-nondet-string-length 10 --java-assume-inputs-non-null --sat-solver cadical
44
^EXIT=0$
55
^SIGNAL=0$
66
^VERIFICATION SUCCESSFUL$
77
--
8+
--
9+
This test completes in less than 3 seconds with CaDiCaL
10+
--
11+
This test completes in less than 3 seconds with CaDiCaL, but may flip between
12+
seconds and several minutes with MiniSat even just changing the order of
13+
equations.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#include <assert.h>
2+
#include <inttypes.h>
3+
4+
int main()
5+
{
6+
#if defined(__clang__) || defined(_GNUC_)
7+
// GCC actually only supports __builtin_bit_cast in C++ mode, but we do it for
8+
// C as well.
9+
float f = 1.5;
10+
assert((int32_t)f == 1);
11+
int32_t i = __builtin_bit_cast(int32_t, f);
12+
assert(i != 1);
13+
assert(__builtin_bit_cast(float, i) == f);
14+
#endif
15+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
main.c
3+
4+
^VERIFICATION SUCCESSFUL$
5+
^EXIT=0$
6+
^SIGNAL=0$
7+
--
8+
^warning: ignoring

src/ansi-c/ansi_c_language.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ bool ansi_c_languaget::parse(
7676
ansi_c_parser.in=&codestr;
7777
ansi_c_parser.for_has_scope=config.ansi_c.for_has_scope;
7878
ansi_c_parser.ts_18661_3_Floatn_types=config.ansi_c.ts_18661_3_Floatn_types;
79+
ansi_c_parser.__float128_is_keyword = config.ansi_c.__float128_is_keyword;
7980
ansi_c_parser.float16_type = config.ansi_c.float16_type;
8081
ansi_c_parser.bf16_type = config.ansi_c.bf16_type;
8182
ansi_c_parser.fp16_type = config.ansi_c.fp16_type;
@@ -201,6 +202,7 @@ bool ansi_c_languaget::to_expr(
201202
ansi_c_parser.in=&i_preprocessed;
202203
ansi_c_parser.for_has_scope = config.ansi_c.for_has_scope;
203204
ansi_c_parser.ts_18661_3_Floatn_types=config.ansi_c.ts_18661_3_Floatn_types;
205+
ansi_c_parser.__float128_is_keyword = config.ansi_c.__float128_is_keyword;
204206
ansi_c_parser.float16_type = config.ansi_c.float16_type;
205207
ansi_c_parser.bf16_type = config.ansi_c.bf16_type;
206208
ansi_c_parser.fp16_type = config.ansi_c.fp16_type;

src/ansi-c/ansi_c_parser.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class ansi_c_parsert:public parsert
3636
cpp11(false),
3737
for_has_scope(false),
3838
ts_18661_3_Floatn_types(false),
39+
__float128_is_keyword(false),
3940
float16_type(false),
4041
bf16_type(false),
4142
fp16_type(false)
@@ -68,6 +69,7 @@ class ansi_c_parsert:public parsert
6869

6970
// ISO/IEC TS 18661-3:2015
7071
bool ts_18661_3_Floatn_types;
72+
bool __float128_is_keyword;
7173
bool float16_type;
7274
bool bf16_type;
7375
bool fp16_type;

src/ansi-c/builtin_factory.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ static bool convert(
5252
ansi_c_parser.in=&in;
5353
ansi_c_parser.for_has_scope=config.ansi_c.for_has_scope;
5454
ansi_c_parser.ts_18661_3_Floatn_types = config.ansi_c.ts_18661_3_Floatn_types;
55+
ansi_c_parser.__float128_is_keyword = config.ansi_c.__float128_is_keyword;
5556
ansi_c_parser.float16_type = config.ansi_c.float16_type;
5657
ansi_c_parser.bf16_type = config.ansi_c.bf16_type;
5758
ansi_c_parser.fp16_type = config.ansi_c.fp16_type;

src/ansi-c/c_expr.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,8 @@ exprt enum_is_in_range_exprt::lower(const namespacet &ns) const
8383

8484
return simplify_expr(disjunction(disjuncts), ns);
8585
}
86+
87+
byte_extract_exprt bit_cast_exprt::lower() const
88+
{
89+
return make_byte_extract(op(), from_integer(0, c_index_type()), type());
90+
}

src/ansi-c/c_expr.h

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Author: Daniel Kroening, [email protected]
1212
/// \file ansi-c/c_expr.h
1313
/// API to expression classes that are internal to the C frontend
1414

15+
#include <util/byte_operators.h>
1516
#include <util/std_code.h>
1617

1718
/// \brief Shuffle elements of one or two vectors, modelled after Clang's
@@ -370,4 +371,51 @@ inline enum_is_in_range_exprt &to_enum_is_in_range_expr(exprt &expr)
370371
return ret;
371372
}
372373

374+
/// \brief Reinterpret the bits of an expression of type `S` as an expression of
375+
/// type `T` where `S` and `T` have the same size.
376+
class bit_cast_exprt : public unary_exprt
377+
{
378+
public:
379+
bit_cast_exprt(exprt expr, typet type)
380+
: unary_exprt(ID_bit_cast, std::move(expr), std::move(type))
381+
{
382+
}
383+
384+
byte_extract_exprt lower() const;
385+
};
386+
387+
template <>
388+
inline bool can_cast_expr<bit_cast_exprt>(const exprt &base)
389+
{
390+
return base.id() == ID_bit_cast;
391+
}
392+
393+
inline void validate_expr(const bit_cast_exprt &value)
394+
{
395+
validate_operands(value, 1, "bit_cast must have one operand");
396+
}
397+
398+
/// \brief Cast an exprt to a \ref bit_cast_exprt
399+
///
400+
/// \a expr must be known to be \ref bit_cast_exprt.
401+
///
402+
/// \param expr: Source expression
403+
/// \return Object of type \ref bit_cast_exprt
404+
inline const bit_cast_exprt &to_bit_cast_expr(const exprt &expr)
405+
{
406+
PRECONDITION(expr.id() == ID_bit_cast);
407+
const bit_cast_exprt &ret = static_cast<const bit_cast_exprt &>(expr);
408+
validate_expr(ret);
409+
return ret;
410+
}
411+
412+
/// \copydoc to_bit_cast_expr(const exprt &)
413+
inline bit_cast_exprt &to_bit_cast_expr(exprt &expr)
414+
{
415+
PRECONDITION(expr.id() == ID_bit_cast);
416+
bit_cast_exprt &ret = static_cast<bit_cast_exprt &>(expr);
417+
validate_expr(ret);
418+
return ret;
419+
}
420+
373421
#endif // CPROVER_ANSI_C_C_EXPR_H

0 commit comments

Comments
 (0)