object-introspection/test/integration/std_conditional.toml
Alastair Robertson 2060a0491e CodeGen v2: Enable independent running without CodeGen v1
Create DrgnExporter to translate Type Graph "Type" nodes into drgn_type
structs, suitable for use in OICache and TreeBuilder.
2023-12-15 14:57:24 +00:00

80 lines
1.7 KiB
TOML

definitions = '''
class A {
int f;
int g;
};
class B {
int h;
};
class C {
public:
// using T = std::conditional_t<alignof(int*) >= sizeof(char), A, B>;
std::conditional_t<alignof(int*) >= sizeof(char), A, B> foo;
};
'''
[cases]
[cases.a]
oil_skip = 'not implemented for treebuilder v2' # https://github.com/facebookexperimental/object-introspection/issues/317
param_types = ["const C&"]
setup = '''
C foo;
return {foo};
'''
expect_json = '''
[
{
"typeName": "ns_std_conditional::C",
"isTypedef": false,
"staticSize": 8,
"dynamicSize": 0,
"members": [
{
"name": "foo",
"typePath": "foo",
"isTypedef": true,
"staticSize": 8,
"dynamicSize": 0,
"members": [
{
"name": "",
"typePath": "",
"typeName": "type",
"isTypedef": true,
"staticSize": 8,
"dynamicSize": 0,
"members": [
{
"name": "",
"typePath": "",
"typeName": "ns_std_conditional::A",
"isTypedef": false,
"staticSize": 8,
"dynamicSize": 0,
"members": [
{
"name": "f",
"typePath": "f",
"isTypedef": false,
"staticSize": 4,
"dynamicSize": 0
},
{
"name": "g",
"typePath": "g",
"isTypedef": false,
"staticSize": 4,
"dynamicSize": 0
}
]
}
]
}
]
}
]
}
]
'''