Skip to content
Merged
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
7 changes: 7 additions & 0 deletions .github/workflows/llgo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,13 @@ jobs:
export LLGO_FULL_RPATH=true
bash .github/workflows/test_demo.sh

- name: Test C header generation
run: |
echo "Testing C header generation in different build modes..."
cd _demo/go/export
chmod +x test.sh
./test.sh

- name: _xtool build tests
run: |
cd _xtool
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*.dll
*.so
*.dylib
*.a

test.db
demo.ll
Expand Down
1 change: 1 addition & 0 deletions _demo/go/export/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
libexport.h
29 changes: 29 additions & 0 deletions _demo/go/export/c/c.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package C

// XType - struct for export.go to use
type XType struct {
ID int32 `json:"id"`
Name string `json:"name"`
Value float64 `json:"value"`
Flag bool `json:"flag"`
}

func XAdd(a, b int) int {
return a + b
}

func Sub(a, b int64) int64 {
return a - b
}

func sub(a, b uint32) uint32 {
return a - b
}

func Xmul(a, b float32) float32 {
return a * b
}

func Concat(a, b string) string {
return a + b
}
Loading
Loading