issue5548_c.c 454 B

123456789101112131415161718192021222324
  1. // Copyright 2013 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. #include "_cgo_export.h"
  5. static void clobber_stack() {
  6. volatile char a[1024];
  7. int i;
  8. for(i = 0; i < sizeof a; i++)
  9. a[i] = 0xff;
  10. }
  11. static int call_go() {
  12. GoString s;
  13. s.p = "test";
  14. s.n = 4;
  15. return issue5548FromC(s, 42);
  16. }
  17. int issue5548_in_c() {
  18. clobber_stack();
  19. return call_go();
  20. }