tests: autogenerated test to confirm attribute strings

Test helps verify our attribute types match the macros in textflag.h.
Discovered https://golang.org/issue/29487 in the process.

Updates #2
This commit is contained in:
Michael McLoughlin
2018-12-31 17:30:03 -08:00
parent 6d6ff3cfc1
commit f2315d539c
5 changed files with 1657 additions and 11 deletions

View File

@@ -13,7 +13,8 @@ func TestAttributeAsm(t *testing.T) {
{DUPOK, "DUPOK"},
{RODATA | NOSPLIT, "NOSPLIT|RODATA"},
{WRAPPER | 16384 | NOPTR, "NOPTR|WRAPPER|16384"},
{NEEDCTXT + NOFRAME + TLSBSS + REFLECTMETHOD, "NEEDCTXT|TLSBSS|NOFRAME|REFLECTMETHOD"},
{NEEDCTXT + NOFRAME + TLSBSS, "NEEDCTXT|TLSBSS|NOFRAME"},
{REFLECTMETHOD, "1024"}, // REFLECTMETHOD special case due to https://golang.org/issue/29487
}
for _, c := range cases {
got := c.Attribute.Asm()