Skip to content

Instantly share code, notes, and snippets.

View pepyakin's full-sized avatar

Sergei Shulepov pepyakin

View GitHub Profile
This file has been truncated, but you can view the full file.
(module
(type (;0;) (func (param i32)))
(type (;1;) (func (param i32 i32 i32) (result i32)))
(type (;2;) (func (param i32 i32) (result i32)))
(type (;3;) (func (param i32) (result i64)))
(type (;4;) (func (param i32 i32 i32)))
(type (;5;) (func (param i32 i32 i32 i32 i32 i32 i32 i32 i32 i32)))
(type (;6;) (func))
(type (;7;) (func (param i32 i32)))
(type (;8;) (func (param i32 i32 i32 i32)))
; ModuleID = 'main0-317d481089b8c8fe83113de504472633.rs'
source_filename = "main0-317d481089b8c8fe83113de504472633.rs"
target datalayout = "e-p:32:32-i64:64-v128:32:128-n32-S128"
target triple = "asmjs-unknown-emscripten"
%"core::fmt::Arguments" = type { [0 x i8], { [0 x { [0 x i8]*, i32 }]*, i32 }, [0 x i8], %"core::option::Option<&[core::fmt::rt::v1::Argument]>", [0 x i8], { [0 x { i8*, i8* }]*, i32 }, [0 x i8] }
%"core::option::Option<&[core::fmt::rt::v1::Argument]>" = type { [0 x i8], {}*, [4 x i8] }
@str.0 = internal constant [32 x i8] c"assertion failed: descriptor > 0"
@str.1 = internal constant [11 x i8] c"src/main.rs"
; ModuleID = 'main0-317d481089b8c8fe83113de504472633.rs'
source_filename = "main0-317d481089b8c8fe83113de504472633.rs"
target datalayout = "e-p:32:32-i64:64-v128:32:128-n32-S128"
target triple = "asmjs-unknown-emscripten"
%"core::fmt::Arguments" = type { [0 x i8], { [0 x { [0 x i8]*, i32 }]*, i32 }, [0 x i8], %"core::option::Option<&[core::fmt::rt::v1::Argument]>", [0 x i8], { [0 x { i8*, i8* }]*, i32 }, [0 x i8] }
%"core::option::Option<&[core::fmt::rt::v1::Argument]>" = type { [0 x i8], {}*, [4 x i8] }
; Function Attrs: norecurse noreturn nounwind readnone uwtable
define void @rust_begin_unwind(%"core::fmt::Arguments"* byval noalias nocapture dereferenceable(24) %_args, { [0 x i8]*, i32 }* byval noalias nocapture dereferenceable(8) %_file, i32 %_line, i32 %_col) unnamed_addr #0 {
; ModuleID = 'main0-317d481089b8c8fe83113de504472633.rs'
source_filename = "main0-317d481089b8c8fe83113de504472633.rs"
target datalayout = "e-p:32:32-i64:64-v128:32:128-n32-S128"
target triple = "asmjs-unknown-emscripten"
%"core::fmt::Arguments" = type { [0 x i8], { [0 x { [0 x i8]*, i32 }]*, i32 }, [0 x i8], %"core::option::Option<&[core::fmt::rt::v1::Argument]>", [0 x i8], { [0 x { i8*, i8* }]*, i32 }, [0 x i8] }
%"core::option::Option<&[core::fmt::rt::v1::Argument]>" = type { [0 x i8], {}*, [4 x i8] }
@str.0 = internal constant [32 x i8] c"assertion failed: descriptor > 0"
@str.1 = internal constant [11 x i8] c"src/main.rs"
a;
struct b h;
struct b {
struct {
struct {
int c
} d
} e
} f(struct b *i) {
for (; a < i->e.d.c; a++) {
(module
(type $FUNCSIG$vi (func (param i32)))
(import "env" "exit" (func $exit (param i32)))
(table 0 anyfunc)
(memory $0 17)
(data (i32.const 4) " \00\10\00")
(data (i32.const 12) "\00\00\00\00")
(export "memory" (memory $0))
(export "f" (func $f))
(export "main" (func $main))
(module
(type $0 (func))
(type $1 (func (param i32)))
(type $2 (func (param i32 i32) (result i32)))
(type $3 (func (param i32 i32 i32 i32) (result i32)))
(type $4 (func (result i32)))
(import "env" "abort" (func $import$0))
(import "env" "exit" (func $import$1 (param i32)))
(table 0 anyfunc)
(memory $0 17)
/* The Computer Language Benchmarks Game
* http://benchmarksgame.alioth.debian.org/
*
* contributed by Christoph Bauer
*
*/
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
// #![feature(log_syntax)]
// #![feature(trace_macros)]
// trace_macros!(true);
#[derive(Debug, PartialEq, Eq)]
pub struct FuncInstance;
pub struct MemoryInstance;
@pepyakin
pepyakin / macro.rs
Last active January 3, 2018 14:52
cargo expand
struct Resolver;
impl<'a> Data<'a> {
fn resolver() -> Resolver {
Resolver
}
}
impl ImportResolver for Resolver {
fn resolve_func(&self, name: &str, _signature: &FunctionType) -> FuncRef {
if name == "add" {