Esempio n. 1
0
        public void Ahl_ParseSimpleDef_voidfn()
        {
            var arch     = new M68kArchitecture();
            var platform = new AmigaOSPlatform(null, arch);
            var ahl      = new AmigaHeaderLoader(null, "", Encoding.UTF8.GetBytes(
                                                     "[[reko::amiga_function_vector(ExecLibrary, -432)]]  " +
                                                     "void  FrabDevice([[reko::arg(register, \"A1\")]] struct Device * device);"));
            var Q   = ahl.Load(platform, new TypeLibrary());
            var svc = ahl.SystemServices[-432];

            Assert.IsNull(svc.Signature.ReturnValue);
        }
Esempio n. 2
0
        public void Ahl_ParseSimpleDef_voidfn()
        {
            var sc       = new ServiceContainer();
            var arch     = new M68kArchitecture(sc, "m68k", new Dictionary <string, object>());
            var platform = new AmigaOSPlatform(sc, arch);
            var ahl      = new AmigaHeaderLoader(sc, "", Encoding.UTF8.GetBytes(
                                                     "[[reko::amiga_function_vector(ExecLibrary, -432)]]  " +
                                                     "void  FrabDevice([[reko::arg(register, \"A1\")]] struct Device * device);"));
            var Q   = ahl.Load(platform, new TypeLibrary());
            var svc = ahl.SystemServices[-432];

            Assert.IsInstanceOf <VoidType>(svc.Signature.ReturnValue.DataType);
        }
Esempio n. 3
0
        public void Ahl_ParseSimpleDef()
        {
            var arch     = new M68kArchitecture();
            var platform = new AmigaOSPlatform(null, arch);
            var ahl      = new AmigaHeaderLoader(null, "", Encoding.UTF8.GetBytes(
                                                     "[[reko::amiga_function_vector(ExecLibrary, -432)]] [[reko::returns(register,\"A0\")]] " +
                                                     "void * FlobDevice([[reko::arg(register, \"A1\")]] struct Device * device);"));
            var Q   = ahl.Load(platform, new TypeLibrary());
            var svc = ahl.SystemServices[-432];

            Assert.AreEqual("a0", svc.Signature.ReturnValue.Storage.ToString());
            Assert.AreEqual("a1", svc.Signature.Parameters[0].Storage.ToString());
        }
        public void Ahl_ParseSimpleDef()
        {
            var sc       = new ServiceContainer();
            var arch     = new M68kArchitecture(sc, "m68k", new Dictionary <string, object>());
            var platform = new AmigaOSPlatform(sc, arch);
            var ahl      = new AmigaHeaderLoader(sc, ImageLocation.FromUri("file:x"), Encoding.UTF8.GetBytes(
                                                     "[[reko::amiga_function_vector(ExecLibrary, -432)]] [[reko::returns(register,\"A0\")]] " +
                                                     "void * FlobDevice([[reko::arg(register, \"A1\")]] struct Device * device);"));

            ahl.Load(platform, new TypeLibrary());
            var svc = ahl.SystemServices[-432];

            Assert.AreEqual("a0", svc.Signature.ReturnValue.Storage.ToString());
            Assert.AreEqual("a1", svc.Signature.Parameters[0].Storage.ToString());
        }