diff options
Diffstat (limited to 'tests/core/cross/asm.s')
-rw-r--r-- | tests/core/cross/asm.s | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/core/cross/asm.s b/tests/core/cross/asm.s new file mode 100644 index 00000000..7a5d5219 --- /dev/null +++ b/tests/core/cross/asm.s @@ -0,0 +1,15 @@ +// Example assembly copied from https://github.com/rpccloud/goid + +#include "go_asm.h" +#include "textflag.h" + +#ifdef GOARCH_386 +#define get_tls(r) MOVL TLS, r +#define g(r) 0(r)(TLS*1) +#endif + +TEXT ·getg(SB), NOSPLIT, $0-4 + get_tls(CX) + MOVL g(CX), AX + MOVL AX, ret+0(FP) + RET |