mirror of
https://github.com/goplus/llgo.git
synced 2025-09-26 19:51:21 +08:00

- Consolidate _demo, _pydemo, _embdemo into single _demo directory structure - Organize demos by language: _demo/{go,py,c,embed}/ - Categorize demos based on imports: - Python library demos (py imports) → _demo/py/ - C/C++ library demos (c/cpp imports) → _demo/c/ - Go-specific demos → _demo/go/ - Embedded demos → _demo/embed/ - Move C-related demos (asm*, cabi*, cgo*, linkname, targetsbuild) from go/ to c/ - Update all path references in README.md and GitHub workflows - Improve demo organization and navigation as requested in #1256 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
31 lines
536 B
Go
31 lines
536 B
Go
//go:build linux && amd64
|
|
|
|
package main
|
|
|
|
import "unsafe"
|
|
|
|
func verify() {
|
|
// 0 output & 0 input
|
|
asmFull("nop", nil)
|
|
|
|
// 0 output & 1 input with memory address
|
|
addr := uintptr(unsafe.Pointer(&testVar))
|
|
asmFull("movq {value}, ({addr})", map[string]any{
|
|
"addr": addr,
|
|
"value": 43,
|
|
})
|
|
check(43, testVar)
|
|
|
|
// 1 output & 1 input
|
|
res1 := asmFull("movq {value}, {}", map[string]any{
|
|
"value": 41,
|
|
})
|
|
check(41, int(res1))
|
|
|
|
res2 := asmFull("leaq ({a},{b}), {}", map[string]any{
|
|
"a": 25,
|
|
"b": 17,
|
|
})
|
|
check(42, int(res2))
|
|
}
|