-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Commit test output #131
Merged
Merged
Commit test output #131
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
_build | ||
lib/krml | ||
lib/charon | ||
out | ||
test/*/target | ||
out/*/a.out | ||
*.DS_Store | ||
*.orig | ||
*.llbc | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
/* | ||
This file was generated by KaRaMeL <https://github.com/FStarLang/karamel> | ||
|
||
F* version: <unknown> | ||
|
||
*/ | ||
|
||
#include "array.h" | ||
|
||
array_Foo array_mk_foo(void) | ||
{ | ||
uint32_t x[2U] = { 0U }; | ||
uint32_t y[2U] = { 1U, 1U }; | ||
/* Passing arrays by value in Rust generates a copy in C */ | ||
uint32_t copy_of_x[2U]; | ||
memcpy(copy_of_x, x, (size_t)2U * sizeof (uint32_t)); | ||
/* Passing arrays by value in Rust generates a copy in C */ | ||
uint32_t copy_of_y[2U]; | ||
memcpy(copy_of_y, y, (size_t)2U * sizeof (uint32_t)); | ||
array_Foo lit; | ||
memcpy(lit.x, copy_of_x, (size_t)2U * sizeof (uint32_t)); | ||
memcpy(lit.y, copy_of_y, (size_t)2U * sizeof (uint32_t)); | ||
return lit; | ||
} | ||
|
||
array_Foo array_mk_foo2(void) | ||
{ | ||
return array_mk_foo(); | ||
} | ||
|
||
void array_mut_array(uint32_t x[2U]) | ||
{ | ||
x[0U] = 1U; | ||
} | ||
|
||
void array_mut_foo(array_Foo f) | ||
{ | ||
f.x[0U] = 1U; | ||
uint32_t copy[2U]; | ||
memcpy(copy, f.y, (size_t)2U * sizeof (uint32_t)); | ||
copy[0U] = 0U; | ||
} | ||
|
||
/** | ||
A monomorphic instance of array.mk_incr.closure | ||
with const generics | ||
- K= 10 | ||
*/ | ||
uint32_t array_mk_incr_closure_95(size_t i) | ||
{ | ||
return (uint32_t)i; | ||
} | ||
|
||
/** | ||
A monomorphic instance of array.mk_incr | ||
with const generics | ||
- K= 10 | ||
*/ | ||
void array_mk_incr_95(uint32_t ret[10U]) | ||
{ | ||
KRML_MAYBE_FOR10(i, (size_t)0U, (size_t)10U, (size_t)1U, ret[i] = (uint32_t)i;); | ||
} | ||
|
||
typedef struct _uint32_t__x2_s | ||
{ | ||
uint32_t *fst; | ||
uint32_t *snd; | ||
} | ||
_uint32_t__x2; | ||
|
||
void array_main(void) | ||
{ | ||
/* XXX1 */ | ||
array_Foo uu____0 = array_mk_foo2(); | ||
uint32_t x[2U]; | ||
memcpy(x, uu____0.x, (size_t)2U * sizeof (uint32_t)); | ||
uint32_t y[2U]; | ||
memcpy(y, uu____0.y, (size_t)2U * sizeof (uint32_t)); | ||
uint32_t unsigned0 = 0U; | ||
uint32_t uu____1[2U]; | ||
memcpy(uu____1, x, (size_t)2U * sizeof (uint32_t)); | ||
array_mut_array(uu____1); | ||
/* Passing arrays by value in Rust generates a copy in C */ | ||
uint32_t copy_of_x[2U]; | ||
/* XXX2 */ | ||
memcpy(copy_of_x, x, (size_t)2U * sizeof (uint32_t)); | ||
/* Passing arrays by value in Rust generates a copy in C */ | ||
uint32_t copy_of_y[2U]; | ||
memcpy(copy_of_y, y, (size_t)2U * sizeof (uint32_t)); | ||
array_Foo lit; | ||
memcpy(lit.x, copy_of_x, (size_t)2U * sizeof (uint32_t)); | ||
memcpy(lit.y, copy_of_y, (size_t)2U * sizeof (uint32_t)); | ||
array_mut_foo(lit); | ||
_uint32_t__x2 uu____4; | ||
uu____4.fst = x; | ||
uu____4.snd = &unsigned0; | ||
/* XXX3 */ | ||
uint32_t *left_val = uu____4.fst; | ||
uint32_t *right_val0 = uu____4.snd; | ||
EURYDICE_ASSERT(left_val[0U] == right_val0[0U], "panic!"); | ||
uint32_t a[10U]; | ||
array_mk_incr_95(a); | ||
_uint32_t__x2 uu____5; | ||
uu____5.fst = &a[9U]; | ||
/* original Rust expression is not an lvalue in C */ | ||
uint32_t lvalue = 9U; | ||
uu____5.snd = &lvalue; | ||
uint32_t *left_val0 = uu____5.fst; | ||
uint32_t *right_val = uu____5.snd; | ||
EURYDICE_ASSERT(left_val0[0U] == right_val[0U], "panic!"); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
This file was generated by KaRaMeL <https://github.com/FStarLang/karamel> | ||
|
||
F* version: <unknown> | ||
|
||
*/ | ||
|
||
#ifndef __array_H | ||
#define __array_H | ||
|
||
#if defined(__cplusplus) | ||
extern "C" { | ||
#endif | ||
|
||
#include "eurydice_glue.h" | ||
|
||
typedef struct array_Foo_s | ||
{ | ||
uint32_t x[2U]; | ||
uint32_t y[2U]; | ||
} | ||
array_Foo; | ||
|
||
#define core_panicking_AssertKind_Eq 0 | ||
#define core_panicking_AssertKind_Ne 1 | ||
#define core_panicking_AssertKind_Match 2 | ||
|
||
typedef uint8_t core_panicking_AssertKind; | ||
|
||
array_Foo array_mk_foo(void); | ||
|
||
array_Foo array_mk_foo2(void); | ||
|
||
void array_mut_array(uint32_t x[2U]); | ||
|
||
void array_mut_foo(array_Foo f); | ||
|
||
/** | ||
A monomorphic instance of array.mk_incr.closure | ||
with const generics | ||
- K= 10 | ||
*/ | ||
uint32_t array_mk_incr_closure_95(size_t i); | ||
|
||
/** | ||
A monomorphic instance of array.mk_incr | ||
with const generics | ||
- K= 10 | ||
*/ | ||
void array_mk_incr_95(uint32_t ret[10U]); | ||
|
||
void array_main(void); | ||
|
||
#if defined(__cplusplus) | ||
} | ||
#endif | ||
|
||
#define __array_H_DEFINED | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
This file was generated by KaRaMeL <https://github.com/FStarLang/karamel> | ||
|
||
F* version: <unknown> | ||
|
||
*/ | ||
|
||
#include "array2d.h" | ||
|
||
bool array2d_f(uint32_t x[4U][2U]) | ||
{ | ||
x[0U][0U] = 1U; | ||
x[0U][1U] = 2U; | ||
uint32_t y[4U][2U] = { { 1U, 2U }, { 3U, 4U }, { 1U, 2U }, { 3U, 4U } }; | ||
return | ||
core_array_equality___core__cmp__PartialEq__Array_U__N___for__Array_T__N____eq((size_t)4U, | ||
x, | ||
y, | ||
uint32_t [2U], | ||
uint32_t [2U], | ||
bool); | ||
} | ||
|
||
typedef struct _bool__x2_s | ||
{ | ||
bool *fst; | ||
bool *snd; | ||
} | ||
_bool__x2; | ||
|
||
void array2d_main(void) | ||
{ | ||
uint32_t y[4U][2U]; | ||
KRML_MAYBE_FOR4(i, | ||
(size_t)0U, | ||
(size_t)4U, | ||
(size_t)1U, | ||
y[i][0U] = 1U; | ||
y[i][1U] = 2U;); | ||
y[1U][0U] = 3U; | ||
y[1U][1U] = 4U; | ||
y[3U][0U] = 3U; | ||
y[3U][1U] = 4U; | ||
/* Passing arrays by value in Rust generates a copy in C */ | ||
uint32_t copy_of_y[4U][2U]; | ||
memcpy(copy_of_y, y, (size_t)4U * sizeof (uint32_t [2U])); | ||
bool actual = array2d_f(copy_of_y); | ||
bool expected = true; | ||
_bool__x2 uu____1 = { .fst = &actual, .snd = &expected }; | ||
bool *left_val = uu____1.fst; | ||
bool *right_val = uu____1.snd; | ||
EURYDICE_ASSERT(left_val[0U] == right_val[0U], "panic!"); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
This file was generated by KaRaMeL <https://github.com/FStarLang/karamel> | ||
|
||
F* version: <unknown> | ||
|
||
*/ | ||
|
||
#ifndef __array2d_H | ||
#define __array2d_H | ||
|
||
#if defined(__cplusplus) | ||
extern "C" { | ||
#endif | ||
|
||
#include "eurydice_glue.h" | ||
|
||
bool array2d_f(uint32_t x[4U][2U]); | ||
|
||
#define core_panicking_AssertKind_Eq 0 | ||
#define core_panicking_AssertKind_Ne 1 | ||
#define core_panicking_AssertKind_Match 2 | ||
|
||
typedef uint8_t core_panicking_AssertKind; | ||
|
||
void array2d_main(void); | ||
|
||
extern bool | ||
core_cmp_impls___core__cmp__PartialEq_u32__for_u32__24__eq(uint32_t *x0, uint32_t *x1); | ||
|
||
extern bool | ||
core_cmp_impls___core__cmp__PartialEq_u32__for_u32__24__ne(uint32_t *x0, uint32_t *x1); | ||
|
||
#if defined(__cplusplus) | ||
} | ||
#endif | ||
|
||
#define __array2d_H_DEFINED | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
This file was generated by KaRaMeL <https://github.com/FStarLang/karamel> | ||
|
||
F* version: <unknown> | ||
|
||
*/ | ||
|
||
#ifndef __Eurydice_H | ||
#define __Eurydice_H | ||
|
||
#if defined(__cplusplus) | ||
extern "C" { | ||
#endif | ||
|
||
#include "eurydice_glue.h" | ||
|
||
/** | ||
A monomorphic instance of core.ops.range.RangeTo | ||
with types size_t | ||
|
||
*/ | ||
typedef size_t core_ops_range_RangeTo_08; | ||
|
||
/** | ||
A monomorphic instance of core.ops.range.RangeFrom | ||
with types size_t | ||
|
||
*/ | ||
typedef size_t core_ops_range_RangeFrom_08; | ||
|
||
#if defined(__cplusplus) | ||
} | ||
#endif | ||
|
||
#define __Eurydice_H_DEFINED | ||
#endif |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Nadrieril Son started reporting issues with this:
@sonmarcho is possibly on OSX where the default version of make is rather old -- we forbid this in some other projects https://github.com/hacl-star/hacl-star/blob/main/Makefile#L46-L49
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm, that looks like a
bash
difference, not amake
differenceThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed an OSX difference: https://apple.stackexchange.com/questions/291287/globstar-invalid-shell-option-name-on-macos-even-with-bash-4-x . I guess I should avoid the glob and do a
find | xargs
dance? I can't believe I can't even rely on having a decently modern bash though :'(.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry I meant bash -- this is the same issue, OSX ships a very outdated bash for GPLv3 reasons
this is the bash version that is bad in OSX:
jonathan@absinthe:~/Code/noise-star/src (main) $ /bin/bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin24)
if you can detect that and error out with a suggestion to
brew install bash
, then I'm fine with it (I personally run with brew bash and everyone else should)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know a reliable way to detect that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since Apple's bash is frozen in time I think it's ok to check for that exact version string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know how to do such a check in a makefile? I'd rather not run it on every test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would do something like
(sketch)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably need to use $$ though to prevent make from attempting variable expansion