Skip to content

Commit fda53b9

Browse files
authored
Merge pull request #374 from formal-land/guillaume-claret@add-axiom-for-assembly-blocks
Add axiom for assembly blocks
2 parents 6ef3281 + b337cff commit fda53b9

19 files changed

+20
-27
lines changed

CoqOfRust/CoqOfRust.v

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ Definition mut_ref : Set -> Set := ref.
115115

116116
Parameter eqb : forall {A : Set}, A -> A -> bool.
117117

118+
(** We replace assembly blocks by a value of type unit. *)
119+
Parameter InlineAssembly : unit.
120+
118121
(** The functions on [Z] should eventually be replaced by functions on the
119122
corresponding integer types. *)
120123
Global Instance Method_Z_abs `{State.Trait} : Notation.Dot "abs" := {

CoqOfRust/blacklist.txt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -122,21 +122,11 @@ examples/traits/supertraits.v
122122
examples/traits/traits.v
123123
examples/unsafe_operations/calling_unsafe_functions.v
124124
examples/unsafe_operations/inline_assembly_clobbered_registers.v
125-
examples/unsafe_operations/inline_assembly_explicit_register_operands.v
126-
examples/unsafe_operations/inline_assembly_inlateout_case_implemented.v
127-
examples/unsafe_operations/inline_assembly_inlateout_case_non_used.v
128125
examples/unsafe_operations/inline_assembly_inlateout_mul.v
129126
examples/unsafe_operations/inline_assembly_inout.v
130-
examples/unsafe_operations/inline_assembly_inputs_and_outputs_another_example_without_mov.v
131127
examples/unsafe_operations/inline_assembly_inputs_and_outputs_another_example.v
132128
examples/unsafe_operations/inline_assembly_inputs_and_outputs.v
133-
examples/unsafe_operations/inline_assembly_labels.v
134-
examples/unsafe_operations/inline_assembly_memory_address_operands.v
135-
examples/unsafe_operations/inline_assembly_options.v
136-
examples/unsafe_operations/inline_assembly_register_template_modifiers.v
137-
examples/unsafe_operations/inline_assembly_scratch_register.v
138129
examples/unsafe_operations/inline_assembly_symbol_operands_and_abi_clobbers.v
139-
examples/unsafe_operations/inline_assembly.v
140130
examples/unsafe_operations/raw_pointers.v
141131
examples/variable_bindings/declare_first.v
142132
examples_axiomatized/custom_types/enums_testcase_linked_list.v

coq_translation/default/examples/unsafe_operations/inline_assembly.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ Require Import CoqOfRust.CoqOfRust.
33

44
(* #[allow(dead_code)] - function was ignored by the compiler *)
55
Definition main `{H' : State.Trait} : M (H := H') unit :=
6-
let _ := InlineAsm in
6+
let _ := InlineAssembly in
77
Pure tt.

coq_translation/default/examples/unsafe_operations/inline_assembly_clobbered_registers.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Require Import CoqOfRust.CoqOfRust.
55
Definition main `{H' : State.Trait} : M (H := H') unit :=
66
let* name_buf := repeat 0 in
77
let _ :=
8-
let _ := InlineAsm in
8+
let _ := InlineAssembly in
99
tt in
1010
let* name :=
1111
let* α0 := core.str.converts.from_utf8 (addr_of name_buf) in

coq_translation/default/examples/unsafe_operations/inline_assembly_explicit_register_operands.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ Require Import CoqOfRust.CoqOfRust.
44
(* #[allow(dead_code)] - function was ignored by the compiler *)
55
Definition main `{H' : State.Trait} : M (H := H') unit :=
66
let cmd := 209 in
7-
let _ := InlineAsm in
7+
let _ := InlineAssembly in
88
Pure tt.

coq_translation/default/examples/unsafe_operations/inline_assembly_inlateout_case_implemented.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Definition main `{H' : State.Trait} : M (H := H') unit :=
66
let a : u64 := 4 in
77
let b : u64 := 4 in
88
let _ :=
9-
let _ := InlineAsm in
9+
let _ := InlineAssembly in
1010
tt in
1111
let* _ :=
1212
match (addr_of a, addr_of 8) with

coq_translation/default/examples/unsafe_operations/inline_assembly_inlateout_case_non_used.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Definition main `{H' : State.Trait} : M (H := H') unit :=
77
let b : u64 := 4 in
88
let c : u64 := 4 in
99
let _ :=
10-
let _ := InlineAsm in
10+
let _ := InlineAssembly in
1111
tt in
1212
let* _ :=
1313
match (addr_of a, addr_of 12) with

coq_translation/default/examples/unsafe_operations/inline_assembly_inlateout_mul.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Definition mul `{H' : State.Trait} (a : u64) (b : u64) : M (H := H') u128 :=
88
let lo : u64 := tt in
99
let hi : u64 := tt in
1010
let _ :=
11-
let _ := InlineAsm in
11+
let _ := InlineAssembly in
1212
tt in
1313
let* α0 := (cast hi u128).["shl"] 64 in
1414
α0.["add"] (cast lo u128).

coq_translation/default/examples/unsafe_operations/inline_assembly_inout.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Definition main `{H' : State.Trait} : M (H := H') unit :=
66
let x : u64 := 3 in
77
let y : u64 := tt in
88
let _ :=
9-
let _ := InlineAsm in
9+
let _ := InlineAssembly in
1010
tt in
1111
let* _ :=
1212
match (addr_of y, addr_of 8) with

coq_translation/default/examples/unsafe_operations/inline_assembly_inputs_and_outputs.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Require Import CoqOfRust.CoqOfRust.
55
Definition main `{H' : State.Trait} : M (H := H') unit :=
66
let x : u64 := tt in
77
let _ :=
8-
let _ := InlineAsm in
8+
let _ := InlineAssembly in
99
tt in
1010
let* _ :=
1111
match (addr_of x, addr_of 5) with

0 commit comments

Comments
 (0)