C++: Add a weird testcase demonstrating invalid IR.

This commit is contained in:
Mathias Vorreiter Pedersen
2023-04-26 17:48:02 +01:00
parent 60aab206b0
commit 1dcac76992
4 changed files with 17 additions and 0 deletions

View File

@@ -20,6 +20,7 @@ unexplainedLoop
unnecessaryPhiInstruction
memoryOperandDefinitionIsUnmodeled
operandAcrossFunctions
| test.c:245:31:245:31 | Condition | Operand 'Condition' is used on instruction 'ConditionalBranch: 0' in function '$@', but is defined on instruction 'Constant: 0' in function '$@'. | file://:0:0:0:0 | <Missing IRFunction> | <Missing IRFunction> | test.c:245:24:245:24 | const void *[] a | const void *[] a |
instructionWithoutUniqueBlock
containsLoopOfForwardEdges
lostReachability
@@ -30,6 +31,7 @@ notMarkedAsConflated
wronglyMarkedAsConflated
invalidOverlap
nonUniqueEnclosingIRFunction
| test.c:245:31:245:31 | ConditionalBranch: 0 | Instruction 'ConditionalBranch: 0' has 0 results for `getEnclosingIRFunction()` in function '$@'. | file://:0:0:0:0 | <Missing IRFunction> | <Missing IRFunction> |
fieldAddressOnNonPointer
thisArgumentIsNonPointer
| pmcallexpr.cpp:10:2:10:15 | Call: call to expression | Call instruction 'Call: call to expression' has a `this` argument operand that is not an address, in function '$@'. | pmcallexpr.cpp:8:13:8:13 | void f() | void f() |

View File

@@ -33,6 +33,7 @@ unexplainedLoop
unnecessaryPhiInstruction
memoryOperandDefinitionIsUnmodeled
operandAcrossFunctions
| test.c:245:31:245:31 | Condition | Operand 'Condition' is used on instruction 'ConditionalBranch: 0' in function '$@', but is defined on instruction 'Constant: 0' in function '$@'. | file://:0:0:0:0 | <Missing IRFunction> | <Missing IRFunction> | test.c:245:24:245:24 | const void *[] a | const void *[] a |
instructionWithoutUniqueBlock
containsLoopOfForwardEdges
lostReachability
@@ -52,6 +53,7 @@ notMarkedAsConflated
wronglyMarkedAsConflated
invalidOverlap
nonUniqueEnclosingIRFunction
| test.c:245:31:245:31 | ConditionalBranch: 0 | Instruction 'ConditionalBranch: 0' has 0 results for `getEnclosingIRFunction()` in function '$@'. | file://:0:0:0:0 | <Missing IRFunction> | <Missing IRFunction> |
fieldAddressOnNonPointer
thisArgumentIsNonPointer
| pmcallexpr.cpp:10:2:10:15 | Call: call to expression | Call instruction 'Call: call to expression' has a `this` argument operand that is not an address, in function '$@'. | pmcallexpr.cpp:8:13:8:13 | void f() | void f() |

View File

@@ -233,3 +233,14 @@ void f_if_ternary_1(int b, int x, int y) {
if (b ? x : y) {
}
}
struct _A
{
unsigned int x;
const char *y;
} as[];
void regression_test(void)
{
static const void *a[] = {0 ? 0 : as};
}

View File

@@ -20,6 +20,7 @@ unexplainedLoop
unnecessaryPhiInstruction
memoryOperandDefinitionIsUnmodeled
operandAcrossFunctions
| test.c:245:31:245:31 | Condition | Operand 'Condition' is used on instruction 'ConditionalBranch: 0' in function '$@', but is defined on instruction 'Constant: 0' in function '$@'. | file://:0:0:0:0 | <Missing IRFunction> | <Missing IRFunction> | test.c:245:24:245:24 | const void *[] a | const void *[] a |
instructionWithoutUniqueBlock
containsLoopOfForwardEdges
lostReachability
@@ -30,6 +31,7 @@ notMarkedAsConflated
wronglyMarkedAsConflated
invalidOverlap
nonUniqueEnclosingIRFunction
| test.c:245:31:245:31 | ConditionalBranch: 0 | Instruction 'ConditionalBranch: 0' has 0 results for `getEnclosingIRFunction()` in function '$@'. | file://:0:0:0:0 | <Missing IRFunction> | <Missing IRFunction> |
fieldAddressOnNonPointer
thisArgumentIsNonPointer
| pmcallexpr.cpp:10:2:10:15 | Call: call to expression | Call instruction 'Call: call to expression' has a `this` argument operand that is not an address, in function '$@'. | pmcallexpr.cpp:8:13:8:13 | void f() | void f() |