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
with Ada.Text_IO; | |
with Interfaces.C.Strings; | |
with GNAT.CPP_Exceptions; | |
procedure cppexc is | |
pragma Linker_Options ("-lstdc++"); | |
use type Interfaces.C.char_array; | |
char_const_ptr : exception; | |
pragma Import (Cpp, char_const_ptr, "_ZTIPKc"); -- typeid(char const *) | |
begin | |
Ada.Text_IO.Put_Line ("throw..."); |
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
*.ali | |
*.o |
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
package dtmodoki is | |
-- minus functions ensuring Left >= Right (Left - Right >= 0) | |
generic | |
X : Natural; | |
Y : Natural; | |
package Natural_Minus is | |
subtype Result is Natural range X - Y .. X - Y; |
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
pragma Annotate (GNATprove, External_Axiomatization); | |
package test1 | |
with Pure, SPARK_Mode | |
is | |
function fact (x : Integer) return Integer is | |
(if x > 0 then | |
x * fact (x - 1) -- overflow check might fail | |
else | |
1); |
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
(* ocaml -I `ocamlc -where`/compiler-libs ocamlcommon.cma toplevelpp.ml *) | |
module L = Longident;; | |
let print_value long_id value = | |
let env = !Toploop.toplevel_env in | |
let value_path, value_desc = Env.lookup_value long_id env in | |
Toploop.print_value | |
env | |
(Obj.repr value) |
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
extern inline int extinl (int x) {return x;} | |
inline int norinl (int x) {return x;} | |
static inline int stainl (int x) {return x;} | |
extern void dummy(int x); | |
void test(void) | |
{ | |
dummy(extinl(1)); | |
dummy(norinl(1)); |
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 is translated by "headmaster" version 0.26-a54347a (devel). | |
-- The original C header's license should be applied to this file. | |
-- All conditional-directives are expanded for the exclusive use of your | |
-- environment, it is not recommended to commit this file to any repository. | |
------------------------------------------------------------------------------- | |
with C.stddef; | |
with C.sys.types; | |
package C.bsm.audit is | |
pragma Preelaborate; | |
subtype au_id_t is sys.types.uid_t; |
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
__attribute__((noinline)) int c_sum(int *data, int n) | |
{ | |
int result = 0; | |
for(int i = 0; i < n; ++i){ | |
result += data[i]; | |
} | |
return result; | |
} |
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
with Ada.Unchecked_Conversion; | |
with Ada.Numerics.Long_Long_Elementary_Functions; | |
with Interfaces; | |
package body URR is | |
function Shift_Left (Value : URR_Representation; Amount : Natural) return URR_Representation; | |
pragma Import (Intrinsic, Shift_Left); | |
function To_URR_Real (X : URR_Representation) return URR_Real is | |
begin |
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
with Ada.Unchecked_Deallocation; | |
with System.Pool_Local; | |
package body Difference is | |
procedure Diff ( | |
Left, Right : in Container_Type; | |
Notify : not null access procedure ( | |
Left_Low : Index_Type; Left_High : Index_Type'Base; | |
Right_Low : Index_Type; Right_High : Index_Type'Base)) | |
is |
OlderNewer