You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.0 KiB
40 lines
1.0 KiB
// Copyright 2019 The Chromium OS 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 main
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestAddNoMovbeFlagOnX86(t *testing.T) {
|
|
withTestContext(t, func(ctx *testContext) {
|
|
cmd := ctx.must(callCompiler(ctx, ctx.cfg,
|
|
ctx.newCommand(gccX86_64, mainCc)))
|
|
if err := verifyArgOrder(cmd, mainCc, "-mno-movbe"); err != nil {
|
|
t.Error(err)
|
|
}
|
|
})
|
|
}
|
|
|
|
func TestAddNoMovbeFlagOnI686(t *testing.T) {
|
|
withTestContext(t, func(ctx *testContext) {
|
|
cmd := ctx.must(callCompiler(ctx, ctx.cfg,
|
|
ctx.newCommand("./i686-cros-linux-gnu-gcc", mainCc)))
|
|
if err := verifyArgOrder(cmd, mainCc, "-mno-movbe"); err != nil {
|
|
t.Error(err)
|
|
}
|
|
})
|
|
}
|
|
|
|
func TestDoNotAddNoMovbeFlagOnArm(t *testing.T) {
|
|
withTestContext(t, func(ctx *testContext) {
|
|
cmd := ctx.must(callCompiler(ctx, ctx.cfg,
|
|
ctx.newCommand(gccArmV7, mainCc)))
|
|
if err := verifyArgCount(cmd, 0, "-mno-movbe"); err != nil {
|
|
t.Error(err)
|
|
}
|
|
})
|
|
}
|