github.com/guyezi/gofrontend@v0.0.0-20200228202240-7a62a49e62c0/libgo/go/runtime/testdata/testprogcxx/traceback.go (about)

     1  // Copyright 2018 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  
     5  package main
     6  
     7  // This program will crash.
     8  // We want the stack trace to include the C++ functions,
     9  // even though we compile with -g0.
    10  
    11  /*
    12  #cgo CXXFLAGS: -g0 -O0
    13  
    14  extern int cxxFunction1(void);
    15  */
    16  import "C"
    17  
    18  func init() {
    19  	register("CrashTracebackNodebug", CrashTracebackNodebug)
    20  }
    21  
    22  func CrashTracebackNodebug() {
    23  	C.cxxFunction1()
    24  }