gcc/libgo/go/debug/elf/elf_test.go
Ian Lance Taylor 7a9389330e Add Go frontend, libgo library, and Go testsuite.
gcc/:
	* gcc.c (default_compilers): Add entry for ".go".
	* common.opt: Add -static-libgo as a driver option.
	* doc/install.texi (Configuration): Mention libgo as an option for
	--enable-shared.  Mention go as an option for --enable-languages.
	* doc/invoke.texi (Overall Options): Mention .go as a file name
	suffix.  Mention go as a -x option.
	* doc/frontends.texi (G++ and GCC): Mention Go as a supported
	language.
	* doc/sourcebuild.texi (Top Level): Mention libgo.
	* doc/standards.texi (Standards): Add section on Go language.
	Move references for other languages into their own section.
	* doc/contrib.texi (Contributors): Mention that I contributed the
	Go frontend.
gcc/testsuite/:
	* lib/go.exp: New file.
	* lib/go-dg.exp: New file.
	* lib/go-torture.exp: New file.
	* lib/target-supports.exp (check_compile): Match // Go.

From-SVN: r167407
2010-12-03 04:34:57 +00:00

50 lines
1.1 KiB
Go

// Copyright 2009 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 elf
import (
"fmt"
"testing"
)
type nameTest struct {
val interface{}
str string
}
var nameTests = []nameTest{
{ELFOSABI_LINUX, "ELFOSABI_LINUX"},
{ET_EXEC, "ET_EXEC"},
{EM_860, "EM_860"},
{SHN_LOPROC, "SHN_LOPROC"},
{SHT_PROGBITS, "SHT_PROGBITS"},
{SHF_MERGE + SHF_TLS, "SHF_MERGE+SHF_TLS"},
{PT_LOAD, "PT_LOAD"},
{PF_W + PF_R + 0x50, "PF_W+PF_R+0x50"},
{DT_SYMBOLIC, "DT_SYMBOLIC"},
{DF_BIND_NOW, "DF_BIND_NOW"},
{NT_FPREGSET, "NT_FPREGSET"},
{STB_GLOBAL, "STB_GLOBAL"},
{STT_COMMON, "STT_COMMON"},
{STV_HIDDEN, "STV_HIDDEN"},
{R_X86_64_PC32, "R_X86_64_PC32"},
{R_ALPHA_OP_PUSH, "R_ALPHA_OP_PUSH"},
{R_ARM_THM_ABS5, "R_ARM_THM_ABS5"},
{R_386_GOT32, "R_386_GOT32"},
{R_PPC_GOT16_HI, "R_PPC_GOT16_HI"},
{R_SPARC_GOT22, "R_SPARC_GOT22"},
{ET_LOOS + 5, "ET_LOOS+5"},
{ProgFlag(0x50), "0x50"},
}
func TestNames(t *testing.T) {
for i, tt := range nameTests {
s := fmt.Sprint(tt.val)
if s != tt.str {
t.Errorf("#%d: want %q have %q", i, s, tt.str)
}
}
}