Flutter Engine
The Flutter Engine
Classes | Namespaces | Macros | Typedefs | Functions
ffi_test_functions.cc File Reference
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <cinttypes>
#include <cmath>
#include <iostream>
#include <limits>
#include <thread>
#include <sys/mman.h>
#include "bin/ffi_test/ffi_test_fields.h"

Go to the source code of this file.

Classes

struct  dart::VeryLargeStruct
 
struct  dart::Struct9Uint8
 
struct  dart::Struct20BytesHomogeneousInt32Copy
 
struct  dart::Struct4BytesHomogeneousInt16Copy
 
struct  dart::Struct8BytesNestedIntCopy
 
struct  dart::Struct43693
 
struct  dart::Struct46127
 
struct  dart::Struct3BytesPackedIntCopy
 
struct  dart::VarArgs
 

Namespaces

namespace  dart
 

Macros

#define DART_EXPORT    extern "C" __attribute__((visibility("default"))) __attribute((used))
 
#define CHECK(X)
 
#define CHECK_EQ(X, Y)   CHECK((X) == (Y))
 
#define DEFINE_SIZE_OF_AND_SIGN_OF(type_modifier, type, type2)
 
#define TYPES(F)
 

Typedefs

typedef Coord *(* dart::CoordUnOp) (Coord *coord)
 
typedef intptr_t(* dart::IntptrBinOp) (intptr_t a, intptr_t b)
 

Functions

DART_EXPORT void dart::InduceACrash ()
 
DART_EXPORT void dart::SetGlobalVar (int32_t v)
 
DART_EXPORT int32_t dart::GetGlobalVar ()
 
DART_EXPORT Coord dart::GetGlobalStruct ()
 
DART_EXPORT int32_t dart::SumPlus42 (int32_t a, int32_t b)
 
DART_EXPORT uint8_t dart::ReturnMaxUint8 ()
 
DART_EXPORT uint16_t dart::ReturnMaxUint16 ()
 
DART_EXPORT uint32_t dart::ReturnMaxUint32 ()
 
DART_EXPORT int8_t dart::ReturnMinInt8 ()
 
DART_EXPORT int16_t dart::ReturnMinInt16 ()
 
DART_EXPORT int32_t dart::ReturnMinInt32 ()
 
DART_EXPORT uint8_t dart::ReturnMaxUint8v2 ()
 
DART_EXPORT uint16_t dart::ReturnMaxUint16v2 ()
 
DART_EXPORT uint32_t dart::ReturnMaxUint32v2 ()
 
DART_EXPORT int8_t dart::ReturnMinInt8v2 ()
 
DART_EXPORT int16_t dart::ReturnMinInt16v2 ()
 
DART_EXPORT int32_t dart::ReturnMinInt32v2 ()
 
DART_EXPORT intptr_t dart::TakeMaxUint8 (uint8_t x)
 
DART_EXPORT intptr_t dart::TakeMaxUint16 (uint16_t x)
 
DART_EXPORT intptr_t dart::TakeMaxUint32 (uint32_t x)
 
DART_EXPORT intptr_t dart::TakeMinInt8 (int8_t x)
 
DART_EXPORT intptr_t dart::TakeMinInt16 (int16_t x)
 
DART_EXPORT intptr_t dart::TakeMinInt32 (int32_t x)
 
DART_EXPORT intptr_t dart::TakeMaxUint8x10 (uint8_t a, uint8_t b, uint8_t c, uint8_t d, uint8_t e, uint8_t f, uint8_t g, uint8_t h, uint8_t i, uint8_t j)
 
DART_EXPORT int64_t dart::IntComputation (int8_t a, int16_t b, int32_t c, int64_t d)
 
DART_EXPORT int64_t dart::Regress39044 (int64_t a, int8_t b)
 
DART_EXPORT intptr_t dart::Regress40537 (uint8_t x)
 
DART_EXPORT intptr_t dart::Regress40537Variant2 (uint8_t x)
 
DART_EXPORT uint8_t dart::Regress40537Variant3 (intptr_t x)
 
DART_EXPORT int64_t dart::UintComputation (uint8_t a, uint16_t b, uint32_t c, uint64_t d)
 
DART_EXPORT intptr_t dart::Times3 (intptr_t a)
 
DART_EXPORT double dart::Times1_337Double (double a)
 
DART_EXPORT float dart::Times1_337Float (float a)
 
DART_EXPORT intptr_t dart::SumManyInts (intptr_t a, intptr_t b, intptr_t c, intptr_t d, intptr_t e, intptr_t f, intptr_t g, intptr_t h, intptr_t i, intptr_t j)
 
DART_EXPORT int16_t dart::SumManySmallInts (int8_t a, int16_t b, int8_t c, int16_t d, int8_t e, int16_t f, int8_t g, int16_t h, int8_t i, int16_t j)
 
DART_EXPORT double dart::SumFloatsAndDoubles (float a, double b, float c)
 
DART_EXPORT int16_t dart::SumVeryManySmallInts (int8_t a01, int16_t a02, int8_t a03, int16_t a04, int8_t a05, int16_t a06, int8_t a07, int16_t a08, int8_t a09, int16_t a10, int8_t a11, int16_t a12, int8_t a13, int16_t a14, int8_t a15, int16_t a16, int8_t a17, int16_t a18, int8_t a19, int16_t a20, int8_t a21, int16_t a22, int8_t a23, int16_t a24, int8_t a25, int16_t a26, int8_t a27, int16_t a28, int8_t a29, int16_t a30, int8_t a31, int16_t a32, int8_t a33, int16_t a34, int8_t a35, int16_t a36, int8_t a37, int16_t a38, int8_t a39, int16_t a40)
 
DART_EXPORT double dart::SumVeryManyFloatsDoubles (float a01, double a02, float a03, double a04, float a05, double a06, float a07, double a08, float a09, double a10, float a11, double a12, float a13, double a14, float a15, double a16, float a17, double a18, float a19, double a20, float a21, double a22, float a23, double a24, float a25, double a26, float a27, double a28, float a29, double a30, float a31, double a32, float a33, double a34, float a35, double a36, float a37, double a38, float a39, double a40)
 
DART_EXPORT intptr_t dart::SumManyIntsOdd (intptr_t a, intptr_t b, intptr_t c, intptr_t d, intptr_t e, intptr_t f, intptr_t g, intptr_t h, intptr_t i, intptr_t j, intptr_t k)
 
DART_EXPORT double dart::SumManyDoubles (double a, double b, double c, double d, double e, double f, double g, double h, double i, double j)
 
DART_EXPORT double dart::SumManyNumbers (intptr_t a, float b, intptr_t c, double d, intptr_t e, float f, intptr_t g, double h, intptr_t i, float j, intptr_t k, double l, intptr_t m, float n, intptr_t o, double p, intptr_t q, float r, intptr_t s, double t)
 
DART_EXPORT int64_t * dart::Assign1337Index1 (int64_t *a)
 
DART_EXPORT Coorddart::TransposeCoordinate (Coord *coord)
 
DART_EXPORT Coorddart::CoordinateElemAt1 (Coord *coord)
 
DART_EXPORT Coorddart::CoordinateUnOpTrice (CoordUnOp unop, Coord *coord)
 
DART_EXPORT IntptrBinOp dart::IntptrAdditionClosure ()
 
DART_EXPORT intptr_t dart::ApplyTo42And74 (IntptrBinOp binop)
 
DART_EXPORT int64_t * dart::NullableInt64ElemAt1 (int64_t *a)
 
DART_EXPORT int64_t dart::SumVeryLargeStruct (VeryLargeStruct *vls)
 
DART_EXPORT int64_t dart::SumStruct9Uint8 (Struct9Uint8 s9)
 
DART_EXPORT int64_t dart::SumReturnStruct9Uint8 (Struct9Uint8(*callback)(Struct9Uint8 *), Struct9Uint8 *in)
 
DART_EXPORT Struct9Uint8 * dart::AllocStruct9Uint8 ()
 
DART_EXPORT void dart::FreeStruct9Uint8 (Struct9Uint8 *address)
 
DART_EXPORT int64_t dart::SumSmallNumbers (int8_t a, int16_t b, int32_t c, uint8_t d, uint16_t e, uint32_t f)
 
DART_EXPORT uint8_t dart::IsRoughly1337 (float *a)
 
DART_EXPORT void dart::DevNullFloat (float a)
 
DART_EXPORT float dart::InventFloatValue ()
 
DART_EXPORT Struct20BytesHomogeneousInt32Copy dart::PassStructRecursive (int64_t recursionCounter, Struct20BytesHomogeneousInt32Copy a0, Struct20BytesHomogeneousInt32Copy(*f)(int64_t, Struct20BytesHomogeneousInt32Copy))
 
DART_EXPORT void dart::CallbackWithStruct (void(*f)(Struct8BytesNestedIntCopy))
 
DART_EXPORT intptr_t dart::TestSimpleAddition (intptr_t(*add)(int, int))
 
DART_EXPORT intptr_t dart::TestIntComputation (int64_t(*fn)(int8_t, int16_t, int32_t, int64_t))
 
DART_EXPORT intptr_t dart::TestUintComputation (uint64_t(*fn)(uint8_t, uint16_t, uint32_t, uint64_t))
 
DART_EXPORT intptr_t dart::TestSimpleMultiply (double(*fn)(double))
 
DART_EXPORT intptr_t dart::TestSimpleMultiplyFloat (float(*fn)(float))
 
DART_EXPORT intptr_t dart::TestManyInts (intptr_t(*fn)(intptr_t, intptr_t, intptr_t, intptr_t, intptr_t, intptr_t, intptr_t, intptr_t, intptr_t, intptr_t))
 
DART_EXPORT intptr_t dart::TestManyDoubles (double(*fn)(double, double, double, double, double, double, double, double, double, double))
 
DART_EXPORT intptr_t dart::TestManyArgs (double(*fn)(intptr_t a, float b, intptr_t c, double d, intptr_t e, float f, intptr_t g, double h, intptr_t i, float j, intptr_t k, double l, intptr_t m, float n, intptr_t o, double p, intptr_t q, float r, intptr_t s, double t))
 
DART_EXPORT intptr_t dart::TestSumFloatsAndDoubles (double(*fn)(float, double, float))
 
DART_EXPORT intptr_t dart::TestSumVeryManySmallInts (int16_t(*fn)(int8_t, int16_t, int8_t, int16_t, int8_t, int16_t, int8_t, int16_t, int8_t, int16_t, int8_t, int16_t, int8_t, int16_t, int8_t, int16_t, int8_t, int16_t, int8_t, int16_t, int8_t, int16_t, int8_t, int16_t, int8_t, int16_t, int8_t, int16_t, int8_t, int16_t, int8_t, int16_t, int8_t, int16_t, int8_t, int16_t, int8_t, int16_t, int8_t, int16_t))
 
DART_EXPORT intptr_t dart::TestSumVeryManyFloatsDoubles (double(*fn)(float, double, float, double, float, double, float, double, float, double, float, double, float, double, float, double, float, double, float, double, float, double, float, double, float, double, float, double, float, double, float, double, float, double, float, double, float, double, float, double))
 
DART_EXPORT intptr_t dart::TestStore (int64_t *(*fn)(int64_t *a))
 
DART_EXPORT intptr_t dart::TestReturnNull (int32_t(*fn)())
 
DART_EXPORT intptr_t dart::TestNullPointers (int64_t *(*fn)(int64_t *ptr))
 
DART_EXPORT intptr_t dart::TestReturnVoid (intptr_t(*return_void)())
 
DART_EXPORT intptr_t dart::TestThrowExceptionDouble (double(*fn)())
 
DART_EXPORT intptr_t dart::TestThrowExceptionPointer (void *(*fn)())
 
DART_EXPORT intptr_t dart::TestThrowException (intptr_t(*fn)())
 
DART_EXPORT intptr_t dart::TestTakeMaxUint8x10 (intptr_t(*fn)(uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t))
 
DART_EXPORT intptr_t dart::TestReturnMaxUint8 (uint8_t(*fn)())
 
DART_EXPORT void dart::NativeTypePointerParam (void *p)
 
DART_EXPORT void * dart::NativeTypePointerReturn ()
 
DART_EXPORT void dart::CallbackNativeTypePointerParam (void(*f)(void *))
 
DART_EXPORT void dart::CallbackNativeTypePointerReturn (void *(*f)())
 
DART_EXPORT int32_t dart::PassStruct (void *)
 
DART_EXPORT uint64_t dart::Regress43693 (Struct43693 *my_struct)
 
DART_EXPORT Struct46127 dart::Regress46127 ()
 
DART_EXPORT uint64_t dart::SizeOfStruct3BytesPackedInt ()
 
DART_EXPORT int64_t dart::WCharMinValue ()
 
DART_EXPORT int64_t dart::WCharMaxValue ()
 
DART_EXPORT int64_t dart::VariadicStructVarArgs (VarArgs a0,...)
 
DART_EXPORT void dart::CallFunctionOnSameThread (int64_t response_id, void(*fn)(int64_t, int32_t))
 
DART_EXPORT void dart::CallFunctionOnNewThreadBlocking (int64_t response_id, void(*fn)(int64_t, int32_t))
 
DART_EXPORT void dart::CallFunctionOnNewThreadNonBlocking (int64_t response_id, void(*fn)(int64_t, int32_t))
 
DART_EXPORT int32_t dart::CallTwoIntFunction (int32_t(*fn)(int32_t, int32_t), int32_t a, int32_t b)
 
DART_EXPORT void dart::CallTwoIntVoidFunction (void(*fn)(int32_t, int32_t), int32_t a, int32_t b)
 
DART_EXPORT void * dart::CallTwoIntPointerFunction (void *(*fn)(int32_t, int32_t), int32_t a, int32_t b)
 
DART_EXPORT int32_t dart::CallTwoPointerIntFunction (int32_t(*fn)(void *, void *), void *a, void *b)
 
DART_EXPORT char dart::TakeString (char *my_string)
 

Macro Definition Documentation

◆ CHECK

#define CHECK (   X)
Value:
if (!(X)) { \
fprintf(stderr, "%s\n", "Check failed: " #X); \
return 1; \
}
static const SkScalar X
Definition: StrokeBench.cpp:54

Definition at line 39 of file ffi_test_functions.cc.

◆ CHECK_EQ

#define CHECK_EQ (   X,
  Y 
)    CHECK((X) == (Y))

Definition at line 45 of file ffi_test_functions.cc.

◆ DART_EXPORT

#define DART_EXPORT    extern "C" __attribute__((visibility("default"))) __attribute((used))

Definition at line 33 of file ffi_test_functions.cc.

◆ DEFINE_SIZE_OF_AND_SIGN_OF

#define DEFINE_SIZE_OF_AND_SIGN_OF (   type_modifier,
  type,
  type2 
)
Value:
DART_EXPORT uint64_t FfiSizeOf_##type_modifier##_##type##_##type2() { \
return sizeof(type_modifier type type2); \
} \
\
DART_EXPORT uint64_t FfiSignOf_##type_modifier##_##type##_##type2() { \
}
GLenum type
#define DART_EXPORT
static bool is_signed(const Type &type)

Definition at line 1228 of file ffi_test_functions.cc.

◆ TYPES

#define TYPES (   F)
Value:
F(, char, ) /* NOLINT */ \
F(signed, char, ) /* NOLINT */ \
F(unsigned, char, ) /* NOLINT */ \
F(, short, ) /* NOLINT */ \
F(unsigned, short, ) /* NOLINT */ \
F(, int, ) /* NOLINT */ \
F(unsigned, int, ) /* NOLINT */ \
F(, long, ) /* NOLINT */ \
F(unsigned, long, ) /* NOLINT */ \
F(, long, long) /* NOLINT */ \
F(unsigned, long, long) /* NOLINT */ \
F(, intptr_t, ) /* NOLINT */ \
F(, uintptr_t, ) /* NOLINT */ \
F(, size_t, ) /* NOLINT */ \
F(, wchar_t, ) /* NOLINT */
#define F(x)

Definition at line 1237 of file ffi_test_functions.cc.