swh:1:snp:a72e953ecd624a7df6e6196bbdd05851996c5e40
Raw File
Tip revision: af3a36c72de227e8cb3ebc9c4417ad8a9c6aa9bd authored by Rafael Fourquet on 26 August 2016, 09:16:12 UTC
ndigits: add a 'pad' argument
Tip revision: af3a36c
asmvariant.jl
# This file is a part of Julia. License is MIT: https://julialang.org/license

using Base.Test

ix86 = r"i[356]86"

if Sys.ARCH === :x86_64 || ismatch(ix86, string(Sys.ARCH))
    function linear_foo()
        x = 4
        y = 5
    end

    rgx = r"%"
    buf = IOBuffer()
    output=""
    #test that the string output is at&t syntax by checking for occurrences of '%'s
    code_native(buf,linear_foo,(),:att)
    output=String(take!(buf))

    @test ismatch(rgx,output)

    #test that the code output is intel syntax by checking it has no occurrences of '%'
    code_native(buf,linear_foo,(),:intel)
    output=String(take!(buf))

    @test !(ismatch(rgx,output))

    code_native(buf,linear_foo,())
    output=String(take!(buf))

    @test ismatch(rgx, output)
end
back to top