mirror of
https://github.com/golang/go.git
synced 2025-05-09 09:33:03 +00:00
Current code cannot handle string #define macros if those macros are defined via other macros. This CL solve the issue. Updates #18720 Change-Id: Ibed0773d10db3d545bb246b97e81c0d19e3af3d5 Reviewed-on: https://go-review.googlesource.com/41312 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
20 lines
438 B
Go
20 lines
438 B
Go
// Copyright 2017 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package cgotest
|
|
|
|
/*
|
|
#define HELLO "hello"
|
|
#define WORLD "world"
|
|
#define HELLO_WORLD HELLO "\000" WORLD
|
|
*/
|
|
import "C"
|
|
import "testing"
|
|
|
|
func test18720(t *testing.T) {
|
|
if C.HELLO_WORLD != "hello\000world" {
|
|
t.Fatalf(`expected "hello\000world", but got %q`, C.HELLO_WORLD)
|
|
}
|
|
}
|