mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
model: Add tests for import-db
This commit is contained in:
committed by
Alessandro Di Federico
parent
a3b44ae65a
commit
ca344fdd47
@@ -0,0 +1,12 @@
|
||||
|
||||
#
|
||||
# This file is distributed under the MIT License. See LICENSE.md for details.
|
||||
#
|
||||
|
||||
commands:
|
||||
- type: revng.test-import-idb
|
||||
from:
|
||||
- type: revng-qa.idb
|
||||
command: |-
|
||||
revng model import idb $INPUT
|
||||
| revng model compare "${SOURCE}.model.yml"
|
||||
@@ -0,0 +1,45 @@
|
||||
#
|
||||
# This file is distributed under the MIT License. See LICENSE.md for details.
|
||||
#
|
||||
|
||||
Types:
|
||||
- ID: 1284
|
||||
Kind: PrimitiveType
|
||||
PrimitiveKind: Unsigned
|
||||
Size: 4
|
||||
- Kind: EnumType
|
||||
ID: 8119090305649570066
|
||||
CustomName: "A"
|
||||
OriginalName: A
|
||||
UnderlyingType:
|
||||
UnqualifiedType: "/Types/PrimitiveType-1284"
|
||||
Entries:
|
||||
- Value: 0
|
||||
CustomName: "x"
|
||||
OriginalName: x
|
||||
- Value: 1
|
||||
CustomName: "y"
|
||||
OriginalName: 'y'
|
||||
- ID: 256
|
||||
Kind: PrimitiveType
|
||||
PrimitiveKind: Void
|
||||
Size: 0
|
||||
- Kind: TypedefType
|
||||
ID: 1687222338895130802
|
||||
CustomName: "A_"
|
||||
OriginalName: A
|
||||
UnderlyingType:
|
||||
UnqualifiedType: "/Types/EnumType-8119090305649570066"
|
||||
- Kind: CABIFunctionType
|
||||
ID: 5232257417303549612
|
||||
CustomName: "fn"
|
||||
OriginalName: fn
|
||||
ABI: SystemV_x86_64
|
||||
ReturnType:
|
||||
UnqualifiedType: "/Types/PrimitiveType-256"
|
||||
Arguments:
|
||||
- Index: 0
|
||||
Type:
|
||||
UnqualifiedType: "/Types/TypedefType-1687222338895130802"
|
||||
CustomName: "x"
|
||||
OriginalName: x
|
||||
@@ -0,0 +1,32 @@
|
||||
#
|
||||
# This file is distributed under the MIT License. See LICENSE.md for details.
|
||||
#
|
||||
|
||||
Types:
|
||||
- Kind: StructType
|
||||
ID: 17825711661244524544
|
||||
CustomName: "Node"
|
||||
OriginalName: Node
|
||||
Fields:
|
||||
- Offset: 0
|
||||
CustomName: "content_uint32"
|
||||
OriginalName: content_uint32
|
||||
Type:
|
||||
UnqualifiedType: "/Types/TypedefType-16313795245817021241"
|
||||
- Offset: 4
|
||||
CustomName: "prev"
|
||||
OriginalName: prev
|
||||
Type:
|
||||
UnqualifiedType: "/Types/TypedefType-14968854803921815239"
|
||||
Qualifiers:
|
||||
- Kind: Pointer
|
||||
Size: 8
|
||||
- Offset: 12
|
||||
CustomName: "next"
|
||||
OriginalName: next
|
||||
Type:
|
||||
UnqualifiedType: "/Types/TypedefType-14968854803921815239"
|
||||
Qualifiers:
|
||||
- Kind: Pointer
|
||||
Size: 8
|
||||
Size: 20
|
||||
@@ -0,0 +1,48 @@
|
||||
#
|
||||
# This file is distributed under the MIT License. See LICENSE.md for details.
|
||||
#
|
||||
|
||||
Types:
|
||||
- Kind: StructType
|
||||
ID: 8153719478940916065
|
||||
CustomName: "my_struct"
|
||||
OriginalName: my_struct
|
||||
Fields:
|
||||
- Offset: 0
|
||||
CustomName: "second"
|
||||
OriginalName: second
|
||||
Type:
|
||||
UnqualifiedType: "/Types/TypedefType-3436967820219683210"
|
||||
- Offset: 8
|
||||
CustomName: "x"
|
||||
OriginalName: x
|
||||
Type:
|
||||
UnqualifiedType: "/Types/PrimitiveType-1028"
|
||||
- Offset: 12
|
||||
CustomName: "y"
|
||||
OriginalName: 'y'
|
||||
Type:
|
||||
UnqualifiedType: "/Types/PrimitiveType-1028"
|
||||
Size: 16
|
||||
- Kind: TypedefType
|
||||
ID: 3436967820219683210
|
||||
CustomName: "second_struct_"
|
||||
OriginalName: second_struct
|
||||
UnderlyingType:
|
||||
UnqualifiedType: "/Types/StructType-9993798603444101287"
|
||||
- Kind: StructType
|
||||
ID: 9993798603444101287
|
||||
CustomName: "second_struct"
|
||||
OriginalName: second_struct
|
||||
Fields:
|
||||
- Offset: 0
|
||||
CustomName: "a"
|
||||
OriginalName: a
|
||||
Type:
|
||||
UnqualifiedType: "/Types/PrimitiveType-1028"
|
||||
- Offset: 4
|
||||
CustomName: "b"
|
||||
OriginalName: b
|
||||
Type:
|
||||
UnqualifiedType: "/Types/PrimitiveType-1028"
|
||||
Size: 8
|
||||
@@ -0,0 +1,75 @@
|
||||
#
|
||||
# This file is distributed under the MIT License. See LICENSE.md for details.
|
||||
#
|
||||
|
||||
ImportedDynamicFunctions:
|
||||
- OriginalName: qsort
|
||||
CustomName: "qsort_"
|
||||
Prototype: "/Types/CABIFunctionType-3821538295510931842"
|
||||
Types:
|
||||
- Kind: CABIFunctionType
|
||||
ID: 3821538295510931842
|
||||
CustomName: "qsort"
|
||||
OriginalName: qsort
|
||||
ABI: SystemV_x86_64
|
||||
ReturnType:
|
||||
UnqualifiedType: "/Types/PrimitiveType-256"
|
||||
Arguments:
|
||||
- Index: 0
|
||||
Type:
|
||||
UnqualifiedType: "/Types/PrimitiveType-256"
|
||||
Qualifiers:
|
||||
- Kind: Pointer
|
||||
Size: 8
|
||||
CustomName: "base"
|
||||
OriginalName: base
|
||||
- Index: 1
|
||||
Type:
|
||||
UnqualifiedType: "/Types/TypedefType-855760813070670525"
|
||||
CustomName: "nmemb"
|
||||
OriginalName: nmemb
|
||||
- Index: 2
|
||||
Type:
|
||||
UnqualifiedType: "/Types/TypedefType-855760813070670525"
|
||||
CustomName: "size"
|
||||
OriginalName: size
|
||||
- Index: 3
|
||||
Type:
|
||||
UnqualifiedType: "/Types/TypedefType-7339777181910699325"
|
||||
CustomName: "compar"
|
||||
OriginalName: compar
|
||||
- Kind: TypedefType
|
||||
ID: 855760813070670525
|
||||
CustomName: "size_t"
|
||||
OriginalName: size_t
|
||||
UnderlyingType:
|
||||
UnqualifiedType: "/Types/PrimitiveType-1288"
|
||||
- Kind: TypedefType
|
||||
ID: 7339777181910699325
|
||||
CustomName: "prefix___compar_fn_t"
|
||||
OriginalName: __compar_fn_t
|
||||
UnderlyingType:
|
||||
UnqualifiedType: "/Types/CABIFunctionType-5090678720539169893"
|
||||
Qualifiers:
|
||||
- Kind: Pointer
|
||||
Size: 8
|
||||
- Kind: CABIFunctionType
|
||||
ID: 5090678720539169893
|
||||
ABI: SystemV_x86_64
|
||||
ReturnType:
|
||||
UnqualifiedType: "/Types/PrimitiveType-1028"
|
||||
Arguments:
|
||||
- Index: 0
|
||||
Type:
|
||||
UnqualifiedType: "/Types/PrimitiveType-256"
|
||||
Qualifiers:
|
||||
- Kind: Pointer
|
||||
Size: 8
|
||||
- Kind: Const
|
||||
- Index: 1
|
||||
Type:
|
||||
UnqualifiedType: "/Types/PrimitiveType-256"
|
||||
Qualifiers:
|
||||
- Kind: Pointer
|
||||
Size: 8
|
||||
- Kind: Const
|
||||
@@ -0,0 +1,48 @@
|
||||
#
|
||||
# This file is distributed under the MIT License. See LICENSE.md for details.
|
||||
#
|
||||
|
||||
Types:
|
||||
- ID: 1028
|
||||
Kind: PrimitiveType
|
||||
PrimitiveKind: Number
|
||||
Size: 4
|
||||
- ID: 1025
|
||||
Kind: PrimitiveType
|
||||
PrimitiveKind: Number
|
||||
Size: 1
|
||||
- Kind: CABIFunctionType
|
||||
ID: 9061286636309425384
|
||||
CustomName: "main"
|
||||
OriginalName: main
|
||||
ABI: SystemV_x86_64
|
||||
ReturnType:
|
||||
UnqualifiedType: "/Types/PrimitiveType-1028"
|
||||
Arguments:
|
||||
- Index: 0
|
||||
Type:
|
||||
UnqualifiedType: "/Types/PrimitiveType-1028"
|
||||
CustomName: "argc"
|
||||
OriginalName: argc
|
||||
- Index: 1
|
||||
Type:
|
||||
UnqualifiedType: "/Types/PrimitiveType-1025"
|
||||
Qualifiers:
|
||||
- Kind: Pointer
|
||||
Size: 8
|
||||
- Kind: Pointer
|
||||
Size: 8
|
||||
- Kind: Const
|
||||
CustomName: "argv"
|
||||
OriginalName: argv
|
||||
- Index: 2
|
||||
Type:
|
||||
UnqualifiedType: "/Types/PrimitiveType-1025"
|
||||
Qualifiers:
|
||||
- Kind: Pointer
|
||||
Size: 8
|
||||
- Kind: Pointer
|
||||
Size: 8
|
||||
- Kind: Const
|
||||
CustomName: "envp"
|
||||
OriginalName: envp
|
||||
@@ -0,0 +1,51 @@
|
||||
#
|
||||
# This file is distributed under the MIT License. See LICENSE.md for details.
|
||||
#
|
||||
|
||||
Types:
|
||||
- Kind: StructType
|
||||
ID: 12620553074732431538
|
||||
CustomName: "my_struct"
|
||||
OriginalName: my_struct
|
||||
Fields:
|
||||
- Offset: 0
|
||||
CustomName: "x"
|
||||
OriginalName: x
|
||||
Type:
|
||||
UnqualifiedType: "/Types/PrimitiveType-1028"
|
||||
- Offset: 4
|
||||
CustomName: "y"
|
||||
OriginalName: 'y'
|
||||
Type:
|
||||
UnqualifiedType: "/Types/PrimitiveType-1028"
|
||||
- Offset: 8
|
||||
CustomName: "z"
|
||||
OriginalName: z
|
||||
Type:
|
||||
UnqualifiedType: "/Types/TypedefType-626103279023675435"
|
||||
Qualifiers:
|
||||
- Kind: Pointer
|
||||
Size: 8
|
||||
Size: 16
|
||||
- Kind: TypedefType
|
||||
ID: 626103279023675435
|
||||
CustomName: "second_struct_"
|
||||
OriginalName: second_struct
|
||||
UnderlyingType:
|
||||
UnqualifiedType: "/Types/StructType-2113910595525978593"
|
||||
- Kind: StructType
|
||||
ID: 2113910595525978593
|
||||
CustomName: "second_struct"
|
||||
OriginalName: second_struct
|
||||
Fields:
|
||||
- Offset: 0
|
||||
CustomName: "a"
|
||||
OriginalName: a
|
||||
Type:
|
||||
UnqualifiedType: "/Types/PrimitiveType-1028"
|
||||
- Offset: 4
|
||||
CustomName: "b"
|
||||
OriginalName: b
|
||||
Type:
|
||||
UnqualifiedType: "/Types/PrimitiveType-1028"
|
||||
Size: 8
|
||||
@@ -0,0 +1,21 @@
|
||||
#
|
||||
# This file is distributed under the MIT License. See LICENSE.md for details.
|
||||
#
|
||||
|
||||
Types:
|
||||
- Kind: StructType
|
||||
ID: 10354558065911308391
|
||||
CustomName: "my_struct"
|
||||
OriginalName: my_struct
|
||||
Fields:
|
||||
- Offset: 0
|
||||
CustomName: "x"
|
||||
OriginalName: x
|
||||
Type:
|
||||
UnqualifiedType: "/Types/PrimitiveType-1028"
|
||||
- Offset: 4
|
||||
CustomName: "y"
|
||||
OriginalName: 'y'
|
||||
Type:
|
||||
UnqualifiedType: "/Types/PrimitiveType-1028"
|
||||
Size: 8
|
||||
@@ -0,0 +1,28 @@
|
||||
#
|
||||
# This file is distributed under the MIT License. See LICENSE.md for details.
|
||||
#
|
||||
|
||||
Types:
|
||||
- Kind: PrimitiveType
|
||||
ID: 1025
|
||||
PrimitiveKind: Number
|
||||
Size: 1
|
||||
- Kind: CABIFunctionType
|
||||
ID: 13950133128659256343
|
||||
CustomName: "fn"
|
||||
OriginalName: fn
|
||||
ABI: SystemV_x86_64
|
||||
ReturnType:
|
||||
UnqualifiedType: "/Types/TypedefType-11568236181854152965"
|
||||
Arguments:
|
||||
- Index: 0
|
||||
Type:
|
||||
UnqualifiedType: "/Types/TypedefType-11568236181854152965"
|
||||
CustomName: "x"
|
||||
OriginalName: x
|
||||
- Kind: TypedefType
|
||||
ID: 11568236181854152965
|
||||
CustomName: "prefix_uint32_t"
|
||||
OriginalName: uint32_t
|
||||
UnderlyingType:
|
||||
UnqualifiedType: "/Types/PrimitiveType-1025"
|
||||
Reference in New Issue
Block a user