C++: add IR tests for global var with constructor

This commit is contained in:
Robert Marsh
2022-03-30 13:20:26 -04:00
parent 417b0b5353
commit 9d4aac61fd
8 changed files with 71 additions and 0 deletions

View File

@@ -13,6 +13,8 @@ unexplainedLoop
unnecessaryPhiInstruction
memoryOperandDefinitionIsUnmodeled
operandAcrossFunctions
| ir.cpp:1705:18:1705:25 | Address | Operand 'Address' is used on instruction 'IndirectMayWriteSideEffect: call to constructor_only' in function '$@', but is defined on instruction 'VariableAddress: global_4' in function '$@'. | file://:0:0:0:0 | <Missing IRFunction> | <Missing IRFunction> | ir.cpp:1705:18:1705:25 | constructor_only global_4 | constructor_only global_4 |
| ir.cpp:1707:18:1707:25 | Address | Operand 'Address' is used on instruction 'IndirectMayWriteSideEffect: call to constructor_only' in function '$@', but is defined on instruction 'VariableAddress: global_5' in function '$@'. | file://:0:0:0:0 | <Missing IRFunction> | <Missing IRFunction> | ir.cpp:1707:18:1707:25 | constructor_only global_5 | constructor_only global_5 |
instructionWithoutUniqueBlock
containsLoopOfForwardEdges
lostReachability
@@ -23,6 +25,10 @@ notMarkedAsConflated
wronglyMarkedAsConflated
invalidOverlap
nonUniqueEnclosingIRFunction
| ir.cpp:1705:27:1705:28 | CallSideEffect: call to constructor_only | Instruction 'CallSideEffect: call to constructor_only' has 0 results for `getEnclosingIRFunction()` in function '$@'. | file://:0:0:0:0 | <Missing IRFunction> | <Missing IRFunction> |
| ir.cpp:1705:27:1705:28 | IndirectMayWriteSideEffect: call to constructor_only | Instruction 'IndirectMayWriteSideEffect: call to constructor_only' has 0 results for `getEnclosingIRFunction()` in function '$@'. | file://:0:0:0:0 | <Missing IRFunction> | <Missing IRFunction> |
| ir.cpp:1707:28:1707:47 | CallSideEffect: call to constructor_only | Instruction 'CallSideEffect: call to constructor_only' has 0 results for `getEnclosingIRFunction()` in function '$@'. | file://:0:0:0:0 | <Missing IRFunction> | <Missing IRFunction> |
| ir.cpp:1707:28:1707:47 | IndirectMayWriteSideEffect: call to constructor_only | Instruction 'IndirectMayWriteSideEffect: call to constructor_only' has 0 results for `getEnclosingIRFunction()` in function '$@'. | file://:0:0:0:0 | <Missing IRFunction> | <Missing IRFunction> |
fieldAddressOnNonPointer
thisArgumentIsNonPointer
missingCanonicalLanguageType

View File

@@ -13,6 +13,8 @@ unexplainedLoop
unnecessaryPhiInstruction
memoryOperandDefinitionIsUnmodeled
operandAcrossFunctions
| ir.cpp:1705:18:1705:25 | Address | Operand 'Address' is used on instruction 'IndirectMayWriteSideEffect: call to constructor_only' in function '$@', but is defined on instruction 'VariableAddress: global_4' in function '$@'. | file://:0:0:0:0 | <Missing IRFunction> | <Missing IRFunction> | ir.cpp:1705:18:1705:25 | constructor_only global_4 | constructor_only global_4 |
| ir.cpp:1707:18:1707:25 | Address | Operand 'Address' is used on instruction 'IndirectMayWriteSideEffect: call to constructor_only' in function '$@', but is defined on instruction 'VariableAddress: global_5' in function '$@'. | file://:0:0:0:0 | <Missing IRFunction> | <Missing IRFunction> | ir.cpp:1707:18:1707:25 | constructor_only global_5 | constructor_only global_5 |
instructionWithoutUniqueBlock
containsLoopOfForwardEdges
lostReachability
@@ -23,6 +25,10 @@ notMarkedAsConflated
wronglyMarkedAsConflated
invalidOverlap
nonUniqueEnclosingIRFunction
| ir.cpp:1705:27:1705:28 | CallSideEffect: call to constructor_only | Instruction 'CallSideEffect: call to constructor_only' has 0 results for `getEnclosingIRFunction()` in function '$@'. | file://:0:0:0:0 | <Missing IRFunction> | <Missing IRFunction> |
| ir.cpp:1705:27:1705:28 | IndirectMayWriteSideEffect: call to constructor_only | Instruction 'IndirectMayWriteSideEffect: call to constructor_only' has 0 results for `getEnclosingIRFunction()` in function '$@'. | file://:0:0:0:0 | <Missing IRFunction> | <Missing IRFunction> |
| ir.cpp:1707:28:1707:47 | CallSideEffect: call to constructor_only | Instruction 'CallSideEffect: call to constructor_only' has 0 results for `getEnclosingIRFunction()` in function '$@'. | file://:0:0:0:0 | <Missing IRFunction> | <Missing IRFunction> |
| ir.cpp:1707:28:1707:47 | IndirectMayWriteSideEffect: call to constructor_only | Instruction 'IndirectMayWriteSideEffect: call to constructor_only' has 0 results for `getEnclosingIRFunction()` in function '$@'. | file://:0:0:0:0 | <Missing IRFunction> | <Missing IRFunction> |
fieldAddressOnNonPointer
thisArgumentIsNonPointer
missingCanonicalLanguageType

View File

@@ -1701,4 +1701,9 @@ int global_1;
int global_2 = 1;
const int global_3 = 2;
constructor_only global_4(1);
constructor_only global_5 = constructor_only(2);
// semmle-extractor-options: -std=c++17 --clang

View File

@@ -7733,6 +7733,18 @@
| ir.cpp:1703:22:1703:22 | ChiPartial | partial:m1703_5 |
| ir.cpp:1703:22:1703:22 | ChiTotal | total:m1703_2 |
| ir.cpp:1703:22:1703:22 | StoreValue | r1703_4 |
| ir.cpp:1705:18:1705:25 | Address | &:r1705_3 |
| ir.cpp:1705:18:1705:25 | Arg(this) | this:r1705_3 |
| ir.cpp:1705:18:1705:25 | SideEffect | ~m1705_2 |
| ir.cpp:1705:27:1705:27 | Arg(0) | 0:r1705_5 |
| ir.cpp:1705:27:1705:28 | CallTarget | func:r1705_4 |
| ir.cpp:1705:27:1705:28 | SideEffect | ~m? |
| ir.cpp:1707:18:1707:25 | Address | &:r1707_3 |
| ir.cpp:1707:18:1707:25 | Arg(this) | this:r1707_3 |
| ir.cpp:1707:18:1707:25 | SideEffect | ~m1707_2 |
| ir.cpp:1707:28:1707:47 | CallTarget | func:r1707_4 |
| ir.cpp:1707:28:1707:47 | SideEffect | ~m? |
| ir.cpp:1707:46:1707:46 | Arg(0) | 0:r1707_5 |
| perf-regression.cpp:6:3:6:5 | Address | &:r6_5 |
| perf-regression.cpp:6:3:6:5 | Address | &:r6_5 |
| perf-regression.cpp:6:3:6:5 | Address | &:r6_7 |

View File

@@ -20,6 +20,8 @@ unexplainedLoop
unnecessaryPhiInstruction
memoryOperandDefinitionIsUnmodeled
operandAcrossFunctions
| ir.cpp:1705:18:1705:25 | Address | Operand 'Address' is used on instruction 'IndirectMayWriteSideEffect: call to constructor_only' in function '$@', but is defined on instruction 'VariableAddress: global_4' in function '$@'. | file://:0:0:0:0 | <Missing IRFunction> | <Missing IRFunction> | ir.cpp:1705:18:1705:25 | constructor_only global_4 | constructor_only global_4 |
| ir.cpp:1707:18:1707:25 | Address | Operand 'Address' is used on instruction 'IndirectMayWriteSideEffect: call to constructor_only' in function '$@', but is defined on instruction 'VariableAddress: global_5' in function '$@'. | file://:0:0:0:0 | <Missing IRFunction> | <Missing IRFunction> | ir.cpp:1707:18:1707:25 | constructor_only global_5 | constructor_only global_5 |
instructionWithoutUniqueBlock
containsLoopOfForwardEdges
lostReachability
@@ -50,6 +52,10 @@ notMarkedAsConflated
wronglyMarkedAsConflated
invalidOverlap
nonUniqueEnclosingIRFunction
| ir.cpp:1705:27:1705:28 | CallSideEffect: call to constructor_only | Instruction 'CallSideEffect: call to constructor_only' has 0 results for `getEnclosingIRFunction()` in function '$@'. | file://:0:0:0:0 | <Missing IRFunction> | <Missing IRFunction> |
| ir.cpp:1705:27:1705:28 | IndirectMayWriteSideEffect: call to constructor_only | Instruction 'IndirectMayWriteSideEffect: call to constructor_only' has 0 results for `getEnclosingIRFunction()` in function '$@'. | file://:0:0:0:0 | <Missing IRFunction> | <Missing IRFunction> |
| ir.cpp:1707:28:1707:47 | CallSideEffect: call to constructor_only | Instruction 'CallSideEffect: call to constructor_only' has 0 results for `getEnclosingIRFunction()` in function '$@'. | file://:0:0:0:0 | <Missing IRFunction> | <Missing IRFunction> |
| ir.cpp:1707:28:1707:47 | IndirectMayWriteSideEffect: call to constructor_only | Instruction 'IndirectMayWriteSideEffect: call to constructor_only' has 0 results for `getEnclosingIRFunction()` in function '$@'. | file://:0:0:0:0 | <Missing IRFunction> | <Missing IRFunction> |
fieldAddressOnNonPointer
thisArgumentIsNonPointer
missingCanonicalLanguageType

View File

@@ -9040,6 +9040,30 @@ ir.cpp:
# 1703| v1703_7(void) = AliasedUse : ~m?
# 1703| v1703_8(void) = ExitFunction :
# 1705| constructor_only global_4
# 1705| Block 0
# 1705| v1705_1(void) = EnterFunction :
# 1705| mu1705_2(unknown) = AliasedDefinition :
# 1705| r1705_3(glval<constructor_only>) = VariableAddress :
# 1705| r1705_4(glval<unknown>) = FunctionAddress[constructor_only] :
# 1705| r1705_5(int) = Constant[1] :
# 1705| v1705_6(void) = Call[constructor_only] : func:r1705_4, this:r1705_3, 0:r1705_5
# 1705| v1705_7(void) = ReturnVoid :
# 1705| v1705_8(void) = AliasedUse : ~m?
# 1705| v1705_9(void) = ExitFunction :
# 1707| constructor_only global_5
# 1707| Block 0
# 1707| v1707_1(void) = EnterFunction :
# 1707| mu1707_2(unknown) = AliasedDefinition :
# 1707| r1707_3(glval<constructor_only>) = VariableAddress :
# 1707| r1707_4(glval<unknown>) = FunctionAddress[constructor_only] :
# 1707| r1707_5(int) = Constant[2] :
# 1707| v1707_6(void) = Call[constructor_only] : func:r1707_4, this:r1707_3, 0:r1707_5
# 1707| v1707_7(void) = ReturnVoid :
# 1707| v1707_8(void) = AliasedUse : ~m?
# 1707| v1707_9(void) = ExitFunction :
perf-regression.cpp:
# 6| void Big::Big()
# 6| Block 0

View File

@@ -13,6 +13,8 @@ unexplainedLoop
unnecessaryPhiInstruction
memoryOperandDefinitionIsUnmodeled
operandAcrossFunctions
| ir.cpp:1705:18:1705:25 | Address | Operand 'Address' is used on instruction 'IndirectMayWriteSideEffect: call to constructor_only' in function '$@', but is defined on instruction 'VariableAddress: global_4' in function '$@'. | file://:0:0:0:0 | <Missing IRFunction> | <Missing IRFunction> | ir.cpp:1705:18:1705:25 | constructor_only global_4 | constructor_only global_4 |
| ir.cpp:1707:18:1707:25 | Address | Operand 'Address' is used on instruction 'IndirectMayWriteSideEffect: call to constructor_only' in function '$@', but is defined on instruction 'VariableAddress: global_5' in function '$@'. | file://:0:0:0:0 | <Missing IRFunction> | <Missing IRFunction> | ir.cpp:1707:18:1707:25 | constructor_only global_5 | constructor_only global_5 |
instructionWithoutUniqueBlock
containsLoopOfForwardEdges
lostReachability
@@ -23,6 +25,10 @@ notMarkedAsConflated
wronglyMarkedAsConflated
invalidOverlap
nonUniqueEnclosingIRFunction
| ir.cpp:1705:27:1705:28 | CallSideEffect: call to constructor_only | Instruction 'CallSideEffect: call to constructor_only' has 0 results for `getEnclosingIRFunction()` in function '$@'. | file://:0:0:0:0 | <Missing IRFunction> | <Missing IRFunction> |
| ir.cpp:1705:27:1705:28 | IndirectMayWriteSideEffect: call to constructor_only | Instruction 'IndirectMayWriteSideEffect: call to constructor_only' has 0 results for `getEnclosingIRFunction()` in function '$@'. | file://:0:0:0:0 | <Missing IRFunction> | <Missing IRFunction> |
| ir.cpp:1707:28:1707:47 | CallSideEffect: call to constructor_only | Instruction 'CallSideEffect: call to constructor_only' has 0 results for `getEnclosingIRFunction()` in function '$@'. | file://:0:0:0:0 | <Missing IRFunction> | <Missing IRFunction> |
| ir.cpp:1707:28:1707:47 | IndirectMayWriteSideEffect: call to constructor_only | Instruction 'IndirectMayWriteSideEffect: call to constructor_only' has 0 results for `getEnclosingIRFunction()` in function '$@'. | file://:0:0:0:0 | <Missing IRFunction> | <Missing IRFunction> |
fieldAddressOnNonPointer
thisArgumentIsNonPointer
missingCanonicalLanguageType

View File

@@ -13,6 +13,8 @@ unexplainedLoop
unnecessaryPhiInstruction
memoryOperandDefinitionIsUnmodeled
operandAcrossFunctions
| ir.cpp:1705:18:1705:25 | Address | Operand 'Address' is used on instruction 'IndirectMayWriteSideEffect: call to constructor_only' in function '$@', but is defined on instruction 'VariableAddress: global_4' in function '$@'. | file://:0:0:0:0 | <Missing IRFunction> | <Missing IRFunction> | ir.cpp:1705:18:1705:25 | constructor_only global_4 | constructor_only global_4 |
| ir.cpp:1707:18:1707:25 | Address | Operand 'Address' is used on instruction 'IndirectMayWriteSideEffect: call to constructor_only' in function '$@', but is defined on instruction 'VariableAddress: global_5' in function '$@'. | file://:0:0:0:0 | <Missing IRFunction> | <Missing IRFunction> | ir.cpp:1707:18:1707:25 | constructor_only global_5 | constructor_only global_5 |
instructionWithoutUniqueBlock
containsLoopOfForwardEdges
lostReachability
@@ -23,6 +25,10 @@ notMarkedAsConflated
wronglyMarkedAsConflated
invalidOverlap
nonUniqueEnclosingIRFunction
| ir.cpp:1705:27:1705:28 | CallSideEffect: call to constructor_only | Instruction 'CallSideEffect: call to constructor_only' has 0 results for `getEnclosingIRFunction()` in function '$@'. | file://:0:0:0:0 | <Missing IRFunction> | <Missing IRFunction> |
| ir.cpp:1705:27:1705:28 | IndirectMayWriteSideEffect: call to constructor_only | Instruction 'IndirectMayWriteSideEffect: call to constructor_only' has 0 results for `getEnclosingIRFunction()` in function '$@'. | file://:0:0:0:0 | <Missing IRFunction> | <Missing IRFunction> |
| ir.cpp:1707:28:1707:47 | CallSideEffect: call to constructor_only | Instruction 'CallSideEffect: call to constructor_only' has 0 results for `getEnclosingIRFunction()` in function '$@'. | file://:0:0:0:0 | <Missing IRFunction> | <Missing IRFunction> |
| ir.cpp:1707:28:1707:47 | IndirectMayWriteSideEffect: call to constructor_only | Instruction 'IndirectMayWriteSideEffect: call to constructor_only' has 0 results for `getEnclosingIRFunction()` in function '$@'. | file://:0:0:0:0 | <Missing IRFunction> | <Missing IRFunction> |
fieldAddressOnNonPointer
thisArgumentIsNonPointer
missingCanonicalLanguageType