aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/testdata/testprogcgo/traceback_c.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/testdata/testprogcgo/traceback_c.c')
-rw-r--r--src/runtime/testdata/testprogcgo/traceback_c.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/runtime/testdata/testprogcgo/traceback_c.c b/src/runtime/testdata/testprogcgo/traceback_c.c
index 54f44e11fc..56eda8fa8c 100644
--- a/src/runtime/testdata/testprogcgo/traceback_c.c
+++ b/src/runtime/testdata/testprogcgo/traceback_c.c
@@ -2,14 +2,21 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// The C definitions for traceback.go.
+// The C definitions for traceback.go. That file uses //export so
+// it can't put function definitions in the "C" import comment.
#include <stdint.h>
char *p;
+int crashInGo;
+extern void h1(void);
+
int tracebackF3(void) {
- *p = 0;
+ if (crashInGo)
+ h1();
+ else
+ *p = 0;
return 0;
}