Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,8 @@ else
LDFLAGS += -Wl,--export-dynamic
endif

MPFR_CFLAGS := $(shell pkg-config --cflags mpfr)
MPFR_LDFLAGS := $(shell pkg-config --libs mpfr)

CXXFLAGS += $(MPFR_CFLAGS) $(LIBFFI_CFLAGS)
LDFLAGS += $(MPFR_LDFLAGS) $(LIBFFI_LDFLAGS)
CXXFLAGS += $(LIBFFI_CFLAGS)
LDFLAGS += $(LIBFFI_LDFLAGS)

ENABLE_CODE_COVERAGE ?= "yes"

Expand Down Expand Up @@ -147,12 +144,11 @@ copylibs: $(FLXSRC)
$(OUTPUT): $(PRECOMP_GCH) $(CXXOBJ) $(COBJ) $(UTF8REWIND_AR)
@printf "# linking\n"
@mkdir -p $(dir $(OUTPUT))
@$(CXX) -o $@ $(CXXOBJ) $(COBJ) $(LDFLAGS) -Lexternal -L$(shell $(LLVM_CONFIG) --prefix)/lib $(shell $(LLVM_CONFIG) --system-libs --libs core engine native linker bitwriter lto vectorize all-targets object orcjit) -lmpfr -lgmp -lpthread -ldl -lffi -lutf8rewind
@$(CXX) -o $@ $(CXXOBJ) $(COBJ) $(LDFLAGS) -Lexternal -L$(shell $(LLVM_CONFIG) --prefix)/lib $(shell $(LLVM_CONFIG) --system-libs --libs core engine native linker bitwriter lto vectorize all-targets object orcjit) -lpthread -ldl -lffi -lutf8rewind


%.cpp.o: %.cpp
@$(eval DONEFILES += "CPP")
@printf "# compiling [$(words $(DONEFILES))/$(NUMFILES)] $<\n"
@printf "# $<\n"
@$(CXX) $(CXXFLAGS) $(WARNINGS) -include source/include/precompile.h -Isource/include -Iexternal -I$(shell $(LLVM_CONFIG) --includedir) -MMD -MP -o $@ $<

%.h.gch: %.h
Expand Down
11 changes: 11 additions & 0 deletions build/tests/defertest.flx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ import libc as _
public fn doDeferTest()
{
bar()

var i = 0
while true
{
defer i += 1

if i > 15 => break

printf("%d ", i)
}
printf("\n")
}


Expand Down
30 changes: 20 additions & 10 deletions build/tiniest.flx
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,31 @@

import libc

class wrapper<T>
{
init()
{
}
// class wrapper<T>
// {
// init()
// {
// }

// static fn method<U>(a: T, b: U)
// {
// libc::printf("t = %d, u = %d\n", typeid(a), typeid(b));
// }
// }

static fn method<U>(a: T, b: U)
struct Cat<T>
{
fn greet()
{
libc::printf("t = %d, u = %d\n", typeid(a), typeid(b));
libc::printf("uwu\n")
}
}


@entry fn main()
{
wrapper::method(1, "asdf")
libc::printf("hello, world\n")
// wrapper::method(1, "asdf")
// wrapper!<int>::method("bsdf", [ 1 ])

let c: Cat!<int> = Cat()
c.greet()
}
41 changes: 31 additions & 10 deletions build/tmp2/a.flx
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,38 @@

import libc as _

@entry fn main()

// class Foo<T>
struct Foo<T>
{
// let x = bazzle() * 2
// foozle(3)
var i = 0
while true
{
defer { i += 1 }
if i < -30 => break
else if i > 10 => break
x: T

printf("i = %d\n", i)
fn a<U>(x: U) -> U
{
return x
}
}

// class Bar<T>
// {
// init(x: T) { }
// }

fn bar() -> int
{
return 3
}

fn b<X>(x: X) -> str
{
return "nein"
}

@entry fn main()
{
// let f: Foo!<int> = Foo()
// let b = bar!<int>()
// let b1 = Bar(x: 3)

let f = Foo(x: 3).a(b(9))
}
Loading