From b75bf06649df642ed47b5686ed874c82834ea632 Mon Sep 17 00:00:00 2001 From: Jonas Jensen Date: Tue, 24 Sep 2019 13:00:21 +0200 Subject: [PATCH] C++: Accept test changes in other IR tests --- .../signanalysis/SignAnalysis.expected | 30 ++ .../syntax-zoo/aliased_ssa_sanity.expected | 2 +- .../syntax-zoo/raw_sanity.expected | 21 +- .../syntax-zoo/unaliased_ssa_sanity.expected | 2 +- .../GlobalValueNumbering/ir_gvn.expected | 262 ++++++++++-------- 5 files changed, 192 insertions(+), 125 deletions(-) diff --git a/cpp/ql/test/library-tests/rangeanalysis/signanalysis/SignAnalysis.expected b/cpp/ql/test/library-tests/rangeanalysis/signanalysis/SignAnalysis.expected index cdc15c4b45a..4dc280b6ca9 100644 --- a/cpp/ql/test/library-tests/rangeanalysis/signanalysis/SignAnalysis.expected +++ b/cpp/ql/test/library-tests/rangeanalysis/signanalysis/SignAnalysis.expected @@ -13,6 +13,7 @@ | bounded_bounds.c:16:12:16:12 | Load: x | negative strictlyNegative | | bounded_bounds.c:16:12:16:12 | Store: x | negative strictlyNegative | | inline_assembly.c:9:23:9:23 | Uninitialized: definition of y | positive | +| inline_assembly.c:10:3:10:7 | CopyValue: ... = ... | positive strictlyPositive | | inline_assembly.c:10:3:10:7 | Store: ... = ... | positive strictlyPositive | | inline_assembly.c:10:7:10:7 | Constant: (unsigned int)... | positive strictlyPositive | | inline_assembly.c:12:32:12:32 | Load: y | positive strictlyPositive | @@ -27,8 +28,10 @@ | minmax.c:18:37:18:37 | Load: x | positive strictlyPositive | | minmax.c:18:40:18:40 | Load: y | positive strictlyPositive | | minmax.c:18:43:18:43 | Load: z | positive strictlyPositive | +| minmax.c:20:2:24:3 | CopyValue: ... = ... | positive | | minmax.c:20:2:24:3 | Store: ... = ... | positive | | minmax.c:20:6:24:3 | CopyValue: (statement expression) | positive | +| minmax.c:22:18:22:22 | CopyValue: ... = ... | positive strictlyPositive | | minmax.c:22:18:22:22 | Store: ... = ... | positive strictlyPositive | | minmax.c:22:22:22:22 | Load: x | positive strictlyPositive | | minmax.c:23:3:23:3 | Load: t | positive | @@ -37,6 +40,7 @@ | minmax.c:26:40:26:40 | Load: y | positive strictlyPositive | | minmax.c:26:43:26:43 | Load: z | positive | | test.c:7:10:7:10 | Phi: p | positive | +| test.c:8:5:8:19 | CopyValue: ... = ... | positive strictlyPositive | | test.c:8:5:8:19 | Store: ... = ... | positive strictlyPositive | | test.c:8:13:8:17 | Load: count | positive | | test.c:8:13:8:19 | Add: ... + ... | positive strictlyPositive | @@ -44,6 +48,7 @@ | test.c:10:10:10:14 | Load: count | positive | | test.c:10:10:10:14 | Store: count | positive | | test.c:15:10:15:10 | Phi: p | positive | +| test.c:16:5:16:26 | CopyValue: ... = ... | positive | | test.c:16:5:16:26 | Store: ... = ... | positive | | test.c:16:13:16:26 | Rem: ... % ... | positive | | test.c:16:14:16:18 | Load: count | positive | @@ -57,6 +62,7 @@ | test.c:24:5:24:11 | Constant: ... ++ | positive strictlyPositive | | test.c:24:5:24:11 | Load: ... ++ | positive | | test.c:24:5:24:11 | Store: ... ++ | positive strictlyPositive | +| test.c:25:5:25:22 | CopyValue: ... = ... | positive | | test.c:25:5:25:22 | Store: ... = ... | positive | | test.c:25:13:25:17 | Load: count | positive strictlyPositive | | test.c:25:13:25:22 | Rem: ... % ... | positive | @@ -67,6 +73,7 @@ | test.c:33:15:33:15 | Phi: i | positive | | test.c:33:15:33:15 | Phi: i | positive | | test.c:33:19:33:19 | Constant: 2 | positive strictlyPositive | +| test.c:33:22:33:28 | CopyValue: ... = ... | positive strictlyPositive | | test.c:33:22:33:28 | Store: ... = ... | positive strictlyPositive | | test.c:33:26:33:26 | Load: i | positive | | test.c:33:26:33:28 | Add: ... + ... | positive strictlyPositive | @@ -101,6 +108,7 @@ | test.c:51:15:51:17 | Add: ... + ... | positive strictlyPositive | | test.c:51:17:51:17 | Constant: 2 | positive strictlyPositive | | test.c:51:21:51:21 | Constant: 4 | positive strictlyPositive | +| test.c:51:24:51:30 | CopyValue: ... = ... | positive strictlyPositive | | test.c:51:24:51:30 | Store: ... = ... | positive strictlyPositive | | test.c:51:28:51:28 | Load: i | positive | | test.c:51:28:51:30 | Add: ... + ... | positive strictlyPositive | @@ -459,6 +467,7 @@ | test.c:343:5:343:7 | Constant: ... ++ | positive strictlyPositive | | test.c:343:5:343:7 | Load: ... ++ | positive | | test.c:343:5:343:7 | Store: ... ++ | positive strictlyPositive | +| test.c:345:3:345:7 | CopyValue: ... = ... | positive strictlyPositive | | test.c:345:3:345:7 | Store: ... = ... | positive strictlyPositive | | test.c:345:7:345:7 | Load: i | positive strictlyPositive | | test.c:346:7:346:7 | Load: x | positive | @@ -474,6 +483,7 @@ | test.c:356:36:356:37 | Uninitialized: definition of y6 | positive | | test.c:356:40:356:41 | Uninitialized: definition of y7 | positive | | test.c:356:44:356:45 | Uninitialized: definition of y8 | positive | +| test.c:357:3:357:23 | CopyValue: ... = ... | positive | | test.c:357:3:357:23 | Store: ... = ... | positive | | test.c:357:8:357:8 | Load: x | positive | | test.c:357:8:357:23 | Load: ... ? ... : ... | positive | @@ -483,6 +493,7 @@ | test.c:357:12:357:14 | Constant: (unsigned int)... | positive strictlyPositive | | test.c:357:18:357:18 | Load: x | positive | | test.c:357:22:357:23 | Constant: (unsigned int)... | positive strictlyPositive | +| test.c:358:3:358:24 | CopyValue: ... = ... | positive | | test.c:358:3:358:24 | Store: ... = ... | positive | | test.c:358:8:358:8 | Load: x | positive | | test.c:358:8:358:24 | Load: ... ? ... : ... | positive | @@ -494,6 +505,7 @@ | test.c:358:24:358:24 | Load: x | positive | | test.c:365:7:365:7 | Load: x | positive | | test.c:365:11:365:13 | Constant: (unsigned int)... | positive strictlyPositive | +| test.c:366:5:366:15 | CopyValue: ... = ... | positive | | test.c:366:5:366:15 | Store: ... = ... | positive | | test.c:366:10:366:10 | Load: x | positive | | test.c:366:10:366:15 | Load: ... ? ... : ... | positive | @@ -501,6 +513,7 @@ | test.c:366:10:366:15 | Store: ... ? ... : ... | positive | | test.c:366:10:366:15 | Store: ... ? ... : ... | positive strictlyPositive | | test.c:366:15:366:15 | Constant: (unsigned int)... | positive strictlyPositive | +| test.c:367:5:367:17 | CopyValue: ... = ... | positive | | test.c:367:5:367:17 | Store: ... = ... | positive | | test.c:367:10:367:10 | Load: x | positive | | test.c:367:10:367:17 | Load: ... ? ... : ... | positive | @@ -508,6 +521,7 @@ | test.c:367:10:367:17 | Store: ... ? ... : ... | positive | | test.c:367:10:367:17 | Store: ... ? ... : ... | positive strictlyPositive | | test.c:367:15:367:17 | Constant: (unsigned int)... | positive strictlyPositive | +| test.c:368:5:368:21 | CopyValue: ... = ... | positive strictlyPositive | | test.c:368:5:368:21 | Store: ... = ... | positive strictlyPositive | | test.c:368:10:368:21 | Load: ... ? ... : ... | positive strictlyPositive | | test.c:368:10:368:21 | Store: ... ? ... : ... | positive strictlyPositive | @@ -515,6 +529,7 @@ | test.c:368:11:368:13 | Add: ... + ... | positive strictlyPositive | | test.c:368:13:368:13 | Constant: (unsigned int)... | positive strictlyPositive | | test.c:368:19:368:21 | Constant: (unsigned int)... | positive strictlyPositive | +| test.c:369:5:369:36 | CopyValue: ... = ... | positive strictlyPositive | | test.c:369:5:369:36 | Store: ... = ... | positive strictlyPositive | | test.c:369:10:369:36 | Convert: (unsigned int)... | positive strictlyPositive | | test.c:369:10:369:36 | Load: ... ? ... : ... | positive strictlyPositive | @@ -524,6 +539,7 @@ | test.c:369:27:369:29 | Add: ... + ... | positive strictlyPositive | | test.c:369:29:369:29 | Constant: (unsigned int)... | positive strictlyPositive | | test.c:369:36:369:36 | Constant: 5 | positive strictlyPositive | +| test.c:370:5:370:38 | CopyValue: ... = ... | positive strictlyPositive | | test.c:370:5:370:38 | Store: ... = ... | positive strictlyPositive | | test.c:370:10:370:38 | Convert: (unsigned int)... | positive strictlyPositive | | test.c:370:10:370:38 | Load: ... ? ... : ... | positive strictlyPositive | @@ -533,6 +549,7 @@ | test.c:370:27:370:29 | Add: ... + ... | positive strictlyPositive | | test.c:370:29:370:29 | Constant: (unsigned int)... | positive strictlyPositive | | test.c:370:36:370:38 | Constant: 500 | positive strictlyPositive | +| test.c:371:5:371:39 | CopyValue: ... = ... | positive strictlyPositive | | test.c:371:5:371:39 | Store: ... = ... | positive strictlyPositive | | test.c:371:10:371:39 | Convert: (unsigned int)... | positive strictlyPositive | | test.c:371:10:371:39 | Load: ... ? ... : ... | positive strictlyPositive | @@ -570,6 +587,7 @@ | test.c:378:24:378:25 | Uninitialized: definition of y3 | positive | | test.c:378:28:378:29 | Uninitialized: definition of y4 | positive | | test.c:378:32:378:33 | Uninitialized: definition of y5 | positive | +| test.c:379:3:379:24 | CopyValue: ... = ... | positive strictlyPositive | | test.c:379:3:379:24 | Store: ... = ... | positive strictlyPositive | | test.c:379:8:379:8 | Load: x | positive | | test.c:379:8:379:24 | Load: ... ? ... : ... | positive strictlyPositive | @@ -579,6 +597,7 @@ | test.c:379:12:379:14 | Constant: (unsigned int)... | positive strictlyPositive | | test.c:379:18:379:18 | Load: x | positive strictlyPositive | | test.c:379:22:379:24 | Constant: (unsigned int)... | positive strictlyPositive | +| test.c:380:3:380:25 | CopyValue: ... = ... | positive strictlyPositive | | test.c:380:3:380:25 | Store: ... = ... | positive strictlyPositive | | test.c:380:8:380:8 | Load: x | positive | | test.c:380:8:380:25 | Load: ... ? ... : ... | positive strictlyPositive | @@ -588,14 +607,18 @@ | test.c:380:13:380:15 | Constant: (unsigned int)... | positive strictlyPositive | | test.c:380:19:380:21 | Constant: (unsigned int)... | positive strictlyPositive | | test.c:380:25:380:25 | Load: x | positive strictlyPositive | +| test.c:381:3:381:11 | CopyValue: ... = ... | positive strictlyPositive | | test.c:381:3:381:11 | Store: ... = ... | positive strictlyPositive | | test.c:381:8:381:11 | Constant: (unsigned int)... | positive strictlyPositive | +| test.c:382:3:382:11 | CopyValue: ... = ... | positive strictlyPositive | | test.c:382:3:382:11 | Store: ... = ... | positive strictlyPositive | | test.c:382:8:382:11 | Constant: (unsigned int)... | positive strictlyPositive | +| test.c:383:3:383:11 | CopyValue: ... = ... | positive strictlyPositive | | test.c:383:3:383:11 | Store: ... = ... | positive strictlyPositive | | test.c:383:8:383:11 | Constant: (unsigned int)... | positive strictlyPositive | | test.c:384:7:384:7 | Load: x | positive | | test.c:384:12:384:14 | Constant: (unsigned int)... | positive strictlyPositive | +| test.c:385:5:385:21 | CopyValue: ... = ... | positive strictlyPositive | | test.c:385:5:385:21 | Store: ... = ... | positive strictlyPositive | | test.c:385:10:385:21 | Load: ... ? ... : ... | positive strictlyPositive | | test.c:385:10:385:21 | Store: ... ? ... : ... | positive strictlyPositive | @@ -603,6 +626,7 @@ | test.c:385:11:385:15 | Sub: ... - ... | positive | | test.c:385:13:385:15 | Constant: (unsigned int)... | positive strictlyPositive | | test.c:385:21:385:21 | Constant: (unsigned int)... | positive strictlyPositive | +| test.c:386:5:386:21 | CopyValue: ... = ... | positive strictlyPositive | | test.c:386:5:386:21 | Store: ... = ... | positive strictlyPositive | | test.c:386:10:386:21 | Load: ... ? ... : ... | positive strictlyPositive | | test.c:386:10:386:21 | Store: ... ? ... : ... | positive strictlyPositive | @@ -610,6 +634,7 @@ | test.c:386:11:386:15 | Sub: ... - ... | positive | | test.c:386:13:386:15 | Constant: (unsigned int)... | positive strictlyPositive | | test.c:386:21:386:21 | Constant: (unsigned int)... | positive strictlyPositive | +| test.c:387:5:387:38 | CopyValue: ... = ... | positive strictlyPositive | | test.c:387:5:387:38 | Store: ... = ... | positive strictlyPositive | | test.c:387:10:387:38 | Convert: (unsigned int)... | positive strictlyPositive | | test.c:387:10:387:38 | Load: ... ? ... : ... | positive strictlyPositive | @@ -644,17 +669,22 @@ | test.c:394:34:394:36 | Constant: (unsigned int)... | positive strictlyPositive | | test.c:395:16:395:17 | Uninitialized: definition of y1 | positive | | test.c:396:16:396:17 | Uninitialized: definition of y2 | positive | +| test.c:397:3:397:15 | CopyValue: ... = ... | positive strictlyPositive | | test.c:397:3:397:15 | Store: ... = ... | positive strictlyPositive | | test.c:397:9:397:11 | Add: ++ ... | positive strictlyPositive | | test.c:397:9:397:11 | Constant: ++ ... | positive strictlyPositive | | test.c:397:9:397:11 | Load: ++ ... | positive | | test.c:397:9:397:11 | Store: ++ ... | positive strictlyPositive | +| test.c:397:9:397:14 | CopyValue: ... , ... | positive strictlyPositive | | test.c:397:14:397:14 | Load: y | positive strictlyPositive | +| test.c:398:3:398:23 | CopyValue: ... = ... | positive strictlyPositive | | test.c:398:3:398:23 | Store: ... = ... | positive strictlyPositive | | test.c:398:9:398:11 | Add: ... ++ | positive strictlyPositive | | test.c:398:9:398:11 | Constant: ... ++ | positive strictlyPositive | | test.c:398:9:398:11 | Load: ... ++ | positive strictlyPositive | | test.c:398:9:398:11 | Store: ... ++ | positive strictlyPositive | +| test.c:398:9:398:19 | CopyValue: ... , ... | positive strictlyPositive | +| test.c:398:9:398:22 | CopyValue: ... , ... | positive strictlyPositive | | test.c:398:14:398:19 | Add: ... += ... | positive strictlyPositive | | test.c:398:14:398:19 | Load: ... += ... | positive strictlyPositive | | test.c:398:14:398:19 | Store: ... += ... | positive strictlyPositive | diff --git a/cpp/ql/test/library-tests/syntax-zoo/aliased_ssa_sanity.expected b/cpp/ql/test/library-tests/syntax-zoo/aliased_ssa_sanity.expected index 5e76fb042be..a8f98105b08 100644 --- a/cpp/ql/test/library-tests/syntax-zoo/aliased_ssa_sanity.expected +++ b/cpp/ql/test/library-tests/syntax-zoo/aliased_ssa_sanity.expected @@ -21,7 +21,7 @@ instructionWithoutSuccessor | ms_try_mix.cpp:28:12:28:15 | Chi: call to C | | ms_try_mix.cpp:48:10:48:13 | Chi: call to C | | pointer_to_member.cpp:35:11:35:21 | FieldAddress: {...} | -| stmt_expr.cpp:27:5:27:15 | Store: ... = ... | +| stmt_expr.cpp:27:5:27:15 | CopyValue: ... = ... | | vla.c:5:9:5:14 | Uninitialized: definition of matrix | | vla.c:11:6:11:16 | UnmodeledDefinition: vla_typedef | ambiguousSuccessors diff --git a/cpp/ql/test/library-tests/syntax-zoo/raw_sanity.expected b/cpp/ql/test/library-tests/syntax-zoo/raw_sanity.expected index b9c4bd7eba5..e8b34aff726 100644 --- a/cpp/ql/test/library-tests/syntax-zoo/raw_sanity.expected +++ b/cpp/ql/test/library-tests/syntax-zoo/raw_sanity.expected @@ -1,9 +1,10 @@ missingOperand -| condition_decls.cpp:16:6:16:20 | ConditionalBranch: (condition decl) | Instruction 'ConditionalBranch' is missing an expected operand with tag 'Condition' in function '$@'. | condition_decls.cpp:15:6:15:17 | IR: if_decl_bind | void if_decl_bind(int) | -| condition_decls.cpp:26:3:36:3 | Switch: switch (...) ... | Instruction 'Switch' is missing an expected operand with tag 'Condition' in function '$@'. | condition_decls.cpp:25:6:25:21 | IR: switch_decl_bind | void switch_decl_bind(int) | -| condition_decls.cpp:41:9:41:23 | ConditionalBranch: (condition decl) | Instruction 'ConditionalBranch' is missing an expected operand with tag 'Condition' in function '$@'. | condition_decls.cpp:40:6:40:20 | IR: while_decl_bind | void while_decl_bind(int) | -| condition_decls.cpp:48:39:48:53 | ConditionalBranch: (condition decl) | Instruction 'ConditionalBranch' is missing an expected operand with tag 'Condition' in function '$@'. | condition_decls.cpp:47:6:47:18 | IR: for_decl_bind | void for_decl_bind(int) | +| condition_decls.cpp:16:6:16:20 | CopyValue: (condition decl) | Instruction 'CopyValue' is missing an expected operand with tag 'Unary' in function '$@'. | condition_decls.cpp:15:6:15:17 | IR: if_decl_bind | void if_decl_bind(int) | +| condition_decls.cpp:26:10:26:24 | CopyValue: (condition decl) | Instruction 'CopyValue' is missing an expected operand with tag 'Unary' in function '$@'. | condition_decls.cpp:25:6:25:21 | IR: switch_decl_bind | void switch_decl_bind(int) | +| condition_decls.cpp:41:9:41:23 | CopyValue: (condition decl) | Instruction 'CopyValue' is missing an expected operand with tag 'Unary' in function '$@'. | condition_decls.cpp:40:6:40:20 | IR: while_decl_bind | void while_decl_bind(int) | +| condition_decls.cpp:48:39:48:53 | CopyValue: (condition decl) | Instruction 'CopyValue' is missing an expected operand with tag 'Unary' in function '$@'. | condition_decls.cpp:47:6:47:18 | IR: for_decl_bind | void for_decl_bind(int) | | misc.c:125:5:125:11 | CopyValue: (statement expression) | Instruction 'CopyValue' is missing an expected operand with tag 'Unary' in function '$@'. | misc.c:97:6:97:10 | IR: misc3 | void misc3() | +| misc.c:220:3:223:3 | CopyValue: ... = ... | Instruction 'CopyValue' is missing an expected operand with tag 'Unary' in function '$@'. | misc.c:219:5:219:26 | IR: assign_designated_init | int assign_designated_init(someStruct*) | | misc.c:220:3:223:3 | Store: ... = ... | Instruction 'Store' is missing an expected operand with tag 'StoreValue' in function '$@'. | misc.c:219:5:219:26 | IR: assign_designated_init | int assign_designated_init(someStruct*) | | misc.c:220:9:223:3 | FieldAddress: {...} | Instruction 'FieldAddress' is missing an expected operand with tag 'Unary' in function '$@'. | misc.c:219:5:219:26 | IR: assign_designated_init | int assign_designated_init(someStruct*) | | misc.c:220:9:223:3 | FieldAddress: {...} | Instruction 'FieldAddress' is missing an expected operand with tag 'Unary' in function '$@'. | misc.c:219:5:219:26 | IR: assign_designated_init | int assign_designated_init(someStruct*) | @@ -47,13 +48,13 @@ instructionWithoutSuccessor | misc.c:222:10:222:10 | Store: 2 | | ms_assume.cpp:20:12:20:12 | Constant: (bool)... | | ms_try_except.cpp:3:9:3:9 | Uninitialized: definition of x | -| ms_try_except.cpp:7:13:7:17 | Store: ... = ... | +| ms_try_except.cpp:7:13:7:17 | CopyValue: ... = ... | | ms_try_except.cpp:9:19:9:19 | Load: j | -| ms_try_except.cpp:10:13:10:17 | Store: ... = ... | -| ms_try_except.cpp:14:13:14:17 | Store: ... = ... | -| ms_try_except.cpp:17:13:17:17 | Store: ... = ... | +| ms_try_except.cpp:10:13:10:17 | CopyValue: ... = ... | +| ms_try_except.cpp:14:13:14:17 | CopyValue: ... = ... | +| ms_try_except.cpp:17:13:17:17 | CopyValue: ... = ... | | ms_try_except.cpp:19:17:19:21 | Sub: ... - ... | -| ms_try_except.cpp:20:9:20:13 | Store: ... = ... | +| ms_try_except.cpp:20:9:20:13 | CopyValue: ... = ... | | ms_try_mix.cpp:11:12:11:15 | CallSideEffect: call to C | | ms_try_mix.cpp:16:13:16:19 | ThrowValue: throw ... | | ms_try_mix.cpp:18:16:18:19 | CallSideEffect: call to C | @@ -75,7 +76,7 @@ instructionWithoutSuccessor | static_init_templates.cpp:97:27:97:36 | Convert: (void *)... | | static_init_templates.cpp:105:27:105:27 | Constant: (void *)... | | static_init_templates.cpp:105:27:105:27 | Constant: (void *)... | -| stmt_expr.cpp:27:5:27:15 | Store: ... = ... | +| stmt_expr.cpp:27:5:27:15 | CopyValue: ... = ... | | stmt_expr.cpp:29:11:32:11 | CopyValue: (statement expression) | | stmt_in_type.cpp:5:53:5:53 | Constant: 1 | | vla.c:5:9:5:14 | Uninitialized: definition of matrix | diff --git a/cpp/ql/test/library-tests/syntax-zoo/unaliased_ssa_sanity.expected b/cpp/ql/test/library-tests/syntax-zoo/unaliased_ssa_sanity.expected index ab5362cb06c..c8cee7b2a7c 100644 --- a/cpp/ql/test/library-tests/syntax-zoo/unaliased_ssa_sanity.expected +++ b/cpp/ql/test/library-tests/syntax-zoo/unaliased_ssa_sanity.expected @@ -30,7 +30,7 @@ instructionWithoutSuccessor | ms_try_mix.cpp:28:12:28:15 | CallSideEffect: call to C | | ms_try_mix.cpp:48:10:48:13 | CallSideEffect: call to C | | pointer_to_member.cpp:35:11:35:21 | FieldAddress: {...} | -| stmt_expr.cpp:27:5:27:15 | Store: ... = ... | +| stmt_expr.cpp:27:5:27:15 | CopyValue: ... = ... | | vla.c:5:9:5:14 | Uninitialized: definition of matrix | | vla.c:11:6:11:16 | UnmodeledDefinition: vla_typedef | ambiguousSuccessors diff --git a/cpp/ql/test/library-tests/valuenumbering/GlobalValueNumbering/ir_gvn.expected b/cpp/ql/test/library-tests/valuenumbering/GlobalValueNumbering/ir_gvn.expected index 8be4cf4e2c1..4bc9f90cc60 100644 --- a/cpp/ql/test/library-tests/valuenumbering/GlobalValueNumbering/ir_gvn.expected +++ b/cpp/ql/test/library-tests/valuenumbering/GlobalValueNumbering/ir_gvn.expected @@ -40,34 +40,40 @@ test.cpp: # 5| valnum = r0_7 # 5| m0_19(int) = Store : &:r0_18, r0_17 # 5| valnum = r0_17 -# 6| r0_20(glval) = VariableAddress[p0] : +# 5| r0_20(glval) = CopyValue : r0_18 +# 5| valnum = r0_7 +# 6| r0_21(glval) = VariableAddress[p0] : # 6| valnum = r0_3 -# 6| r0_21(int) = Load : &:r0_20, m0_4 +# 6| r0_22(int) = Load : &:r0_21, m0_4 # 6| valnum = m0_4 -# 6| r0_22(glval) = VariableAddress[p1] : +# 6| r0_23(glval) = VariableAddress[p1] : # 6| valnum = r0_5 -# 6| r0_23(int) = Load : &:r0_22, m0_6 +# 6| r0_24(int) = Load : &:r0_23, m0_6 # 6| valnum = m0_6 -# 6| r0_24(int) = Add : r0_21, r0_23 +# 6| r0_25(int) = Add : r0_22, r0_24 # 6| valnum = r0_17 -# 6| r0_25(glval) = VariableAddress[x] : +# 6| r0_26(glval) = VariableAddress[x] : # 6| valnum = r0_7 -# 6| m0_26(int) = Store : &:r0_25, r0_24 +# 6| m0_27(int) = Store : &:r0_26, r0_25 # 6| valnum = r0_17 -# 7| r0_27(glval) = VariableAddress[x] : +# 6| r0_28(glval) = CopyValue : r0_26 +# 6| valnum = r0_7 +# 7| r0_29(glval) = VariableAddress[x] : # 7| valnum = r0_7 -# 7| r0_28(int) = Load : &:r0_27, m0_26 +# 7| r0_30(int) = Load : &:r0_29, m0_27 # 7| valnum = r0_17 -# 7| r0_29(glval) = VariableAddress[y] : +# 7| r0_31(glval) = VariableAddress[y] : # 7| valnum = r0_9 -# 7| m0_30(int) = Store : &:r0_29, r0_28 +# 7| m0_32(int) = Store : &:r0_31, r0_30 # 7| valnum = r0_17 -# 8| v0_31(void) = NoOp : -# 1| r0_32(glval) = VariableAddress[#return] : +# 7| r0_33(glval) = CopyValue : r0_31 +# 7| valnum = r0_9 +# 8| v0_34(void) = NoOp : +# 1| r0_35(glval) = VariableAddress[#return] : # 1| valnum = unique -# 1| v0_33(void) = ReturnValue : &:r0_32 -# 1| v0_34(void) = UnmodeledUse : mu* -# 1| v0_35(void) = ExitFunction : +# 1| v0_36(void) = ReturnValue : &:r0_35 +# 1| v0_37(void) = UnmodeledUse : mu* +# 1| v0_38(void) = ExitFunction : # 12| int test01(int, int) # 12| Block 0 @@ -116,40 +122,46 @@ test.cpp: # 16| valnum = r0_7 # 16| m0_22(int) = Store : &:r0_21, r0_20 # 16| valnum = r0_20 -# 17| r0_23(glval) = VariableAddress[p0] : +# 16| r0_23(glval) = CopyValue : r0_21 +# 16| valnum = r0_7 +# 17| r0_24(glval) = VariableAddress[p0] : # 17| valnum = r0_3 -# 17| r0_24(int) = Load : &:r0_23, m0_4 +# 17| r0_25(int) = Load : &:r0_24, m0_4 # 17| valnum = m0_4 -# 17| r0_25(glval) = VariableAddress[p1] : +# 17| r0_26(glval) = VariableAddress[p1] : # 17| valnum = r0_5 -# 17| r0_26(int) = Load : &:r0_25, m0_6 +# 17| r0_27(int) = Load : &:r0_26, m0_6 # 17| valnum = m0_6 -# 17| r0_27(int) = Add : r0_24, r0_26 +# 17| r0_28(int) = Add : r0_25, r0_27 # 17| valnum = r0_17 -# 17| r0_28(glval) = VariableAddress[global01] : +# 17| r0_29(glval) = VariableAddress[global01] : # 17| valnum = r0_18 -# 17| r0_29(int) = Load : &:r0_28, ~m0_1 +# 17| r0_30(int) = Load : &:r0_29, ~m0_1 # 17| valnum = unique -# 17| r0_30(int) = Add : r0_27, r0_29 -# 17| valnum = r0_30 -# 17| r0_31(glval) = VariableAddress[x] : +# 17| r0_31(int) = Add : r0_28, r0_30 +# 17| valnum = r0_31 +# 17| r0_32(glval) = VariableAddress[x] : # 17| valnum = r0_7 -# 17| m0_32(int) = Store : &:r0_31, r0_30 -# 17| valnum = r0_30 -# 18| r0_33(glval) = VariableAddress[x] : +# 17| m0_33(int) = Store : &:r0_32, r0_31 +# 17| valnum = r0_31 +# 17| r0_34(glval) = CopyValue : r0_32 +# 17| valnum = r0_7 +# 18| r0_35(glval) = VariableAddress[x] : # 18| valnum = r0_7 -# 18| r0_34(int) = Load : &:r0_33, m0_32 -# 18| valnum = r0_30 -# 18| r0_35(glval) = VariableAddress[y] : +# 18| r0_36(int) = Load : &:r0_35, m0_33 +# 18| valnum = r0_31 +# 18| r0_37(glval) = VariableAddress[y] : # 18| valnum = r0_9 -# 18| m0_36(int) = Store : &:r0_35, r0_34 -# 18| valnum = r0_30 -# 19| v0_37(void) = NoOp : -# 12| r0_38(glval) = VariableAddress[#return] : +# 18| m0_38(int) = Store : &:r0_37, r0_36 +# 18| valnum = r0_31 +# 18| r0_39(glval) = CopyValue : r0_37 +# 18| valnum = r0_9 +# 19| v0_40(void) = NoOp : +# 12| r0_41(glval) = VariableAddress[#return] : # 12| valnum = unique -# 12| v0_39(void) = ReturnValue : &:r0_38 -# 12| v0_40(void) = UnmodeledUse : mu* -# 12| v0_41(void) = ExitFunction : +# 12| v0_42(void) = ReturnValue : &:r0_41 +# 12| v0_43(void) = UnmodeledUse : mu* +# 12| v0_44(void) = ExitFunction : # 25| int test02(int, int) # 25| Block 0 @@ -198,47 +210,53 @@ test.cpp: # 29| valnum = r0_7 # 29| m0_22(int) = Store : &:r0_21, r0_20 # 29| valnum = r0_20 -# 30| r0_23(glval) = FunctionAddress[change_global02] : +# 29| r0_23(glval) = CopyValue : r0_21 +# 29| valnum = r0_7 +# 30| r0_24(glval) = FunctionAddress[change_global02] : # 30| valnum = unique -# 30| v0_24(void) = Call : func:r0_23 -# 30| m0_25(unknown) = ^CallSideEffect : ~m0_1 +# 30| v0_25(void) = Call : func:r0_24 +# 30| m0_26(unknown) = ^CallSideEffect : ~m0_1 # 30| valnum = unique -# 30| m0_26(unknown) = Chi : total:m0_1, partial:m0_25 +# 30| m0_27(unknown) = Chi : total:m0_1, partial:m0_26 # 30| valnum = unique -# 31| r0_27(glval) = VariableAddress[p0] : +# 31| r0_28(glval) = VariableAddress[p0] : # 31| valnum = r0_3 -# 31| r0_28(int) = Load : &:r0_27, m0_4 +# 31| r0_29(int) = Load : &:r0_28, m0_4 # 31| valnum = m0_4 -# 31| r0_29(glval) = VariableAddress[p1] : +# 31| r0_30(glval) = VariableAddress[p1] : # 31| valnum = r0_5 -# 31| r0_30(int) = Load : &:r0_29, m0_6 +# 31| r0_31(int) = Load : &:r0_30, m0_6 # 31| valnum = m0_6 -# 31| r0_31(int) = Add : r0_28, r0_30 +# 31| r0_32(int) = Add : r0_29, r0_31 # 31| valnum = r0_17 -# 31| r0_32(glval) = VariableAddress[global02] : +# 31| r0_33(glval) = VariableAddress[global02] : # 31| valnum = r0_18 -# 31| r0_33(int) = Load : &:r0_32, ~m0_26 +# 31| r0_34(int) = Load : &:r0_33, ~m0_27 # 31| valnum = unique -# 31| r0_34(int) = Add : r0_31, r0_33 -# 31| valnum = r0_34 -# 31| r0_35(glval) = VariableAddress[x] : +# 31| r0_35(int) = Add : r0_32, r0_34 +# 31| valnum = r0_35 +# 31| r0_36(glval) = VariableAddress[x] : # 31| valnum = r0_7 -# 31| m0_36(int) = Store : &:r0_35, r0_34 -# 31| valnum = r0_34 -# 32| r0_37(glval) = VariableAddress[x] : +# 31| m0_37(int) = Store : &:r0_36, r0_35 +# 31| valnum = r0_35 +# 31| r0_38(glval) = CopyValue : r0_36 +# 31| valnum = r0_7 +# 32| r0_39(glval) = VariableAddress[x] : # 32| valnum = r0_7 -# 32| r0_38(int) = Load : &:r0_37, m0_36 -# 32| valnum = r0_34 -# 32| r0_39(glval) = VariableAddress[y] : +# 32| r0_40(int) = Load : &:r0_39, m0_37 +# 32| valnum = r0_35 +# 32| r0_41(glval) = VariableAddress[y] : # 32| valnum = r0_9 -# 32| m0_40(int) = Store : &:r0_39, r0_38 -# 32| valnum = r0_34 -# 33| v0_41(void) = NoOp : -# 25| r0_42(glval) = VariableAddress[#return] : +# 32| m0_42(int) = Store : &:r0_41, r0_40 +# 32| valnum = r0_35 +# 32| r0_43(glval) = CopyValue : r0_41 +# 32| valnum = r0_9 +# 33| v0_44(void) = NoOp : +# 25| r0_45(glval) = VariableAddress[#return] : # 25| valnum = unique -# 25| v0_43(void) = ReturnValue : &:r0_42 -# 25| v0_44(void) = UnmodeledUse : mu* -# 25| v0_45(void) = ExitFunction : +# 25| v0_46(void) = ReturnValue : &:r0_45 +# 25| v0_47(void) = UnmodeledUse : mu* +# 25| v0_48(void) = ExitFunction : # 39| int test03(int, int, int*) # 39| Block 0 @@ -291,50 +309,60 @@ test.cpp: # 43| valnum = r0_9 # 43| m0_24(int) = Store : &:r0_23, r0_22 # 43| valnum = r0_22 -# 44| r0_25(int) = Constant[0] : -# 44| valnum = r0_25 -# 44| r0_26(glval) = VariableAddress[p2] : +# 43| r0_25(glval) = CopyValue : r0_23 +# 43| valnum = r0_9 +# 44| r0_26(int) = Constant[0] : +# 44| valnum = r0_26 +# 44| r0_27(glval) = VariableAddress[p2] : # 44| valnum = r0_7 -# 44| r0_27(int *) = Load : &:r0_26, m0_8 +# 44| r0_28(int *) = Load : &:r0_27, m0_8 # 44| valnum = m0_8 -# 44| m0_28(int) = Store : &:r0_27, r0_25 -# 44| valnum = r0_25 -# 44| m0_29(unknown) = Chi : total:m0_1, partial:m0_28 +# 44| r0_29(glval) = CopyValue : r0_28 +# 44| valnum = m0_8 +# 44| m0_30(int) = Store : &:r0_29, r0_26 +# 44| valnum = r0_26 +# 44| m0_31(unknown) = Chi : total:m0_1, partial:m0_30 # 44| valnum = unique -# 45| r0_30(glval) = VariableAddress[p0] : +# 44| r0_32(glval) = CopyValue : r0_29 +# 44| valnum = m0_8 +# 45| r0_33(glval) = VariableAddress[p0] : # 45| valnum = r0_3 -# 45| r0_31(int) = Load : &:r0_30, m0_4 +# 45| r0_34(int) = Load : &:r0_33, m0_4 # 45| valnum = m0_4 -# 45| r0_32(glval) = VariableAddress[p1] : +# 45| r0_35(glval) = VariableAddress[p1] : # 45| valnum = r0_5 -# 45| r0_33(int) = Load : &:r0_32, m0_6 +# 45| r0_36(int) = Load : &:r0_35, m0_6 # 45| valnum = m0_6 -# 45| r0_34(int) = Add : r0_31, r0_33 -# 45| valnum = r0_19 -# 45| r0_35(glval) = VariableAddress[global03] : -# 45| valnum = r0_20 -# 45| r0_36(int) = Load : &:r0_35, ~m0_29 -# 45| valnum = unique # 45| r0_37(int) = Add : r0_34, r0_36 -# 45| valnum = r0_37 -# 45| r0_38(glval) = VariableAddress[x] : +# 45| valnum = r0_19 +# 45| r0_38(glval) = VariableAddress[global03] : +# 45| valnum = r0_20 +# 45| r0_39(int) = Load : &:r0_38, ~m0_31 +# 45| valnum = unique +# 45| r0_40(int) = Add : r0_37, r0_39 +# 45| valnum = r0_40 +# 45| r0_41(glval) = VariableAddress[x] : # 45| valnum = r0_9 -# 45| m0_39(int) = Store : &:r0_38, r0_37 -# 45| valnum = r0_37 -# 46| r0_40(glval) = VariableAddress[x] : +# 45| m0_42(int) = Store : &:r0_41, r0_40 +# 45| valnum = r0_40 +# 45| r0_43(glval) = CopyValue : r0_41 +# 45| valnum = r0_9 +# 46| r0_44(glval) = VariableAddress[x] : # 46| valnum = r0_9 -# 46| r0_41(int) = Load : &:r0_40, m0_39 -# 46| valnum = r0_37 -# 46| r0_42(glval) = VariableAddress[y] : +# 46| r0_45(int) = Load : &:r0_44, m0_42 +# 46| valnum = r0_40 +# 46| r0_46(glval) = VariableAddress[y] : # 46| valnum = r0_11 -# 46| m0_43(int) = Store : &:r0_42, r0_41 -# 46| valnum = r0_37 -# 47| v0_44(void) = NoOp : -# 39| r0_45(glval) = VariableAddress[#return] : +# 46| m0_47(int) = Store : &:r0_46, r0_45 +# 46| valnum = r0_40 +# 46| r0_48(glval) = CopyValue : r0_46 +# 46| valnum = r0_11 +# 47| v0_49(void) = NoOp : +# 39| r0_50(glval) = VariableAddress[#return] : # 39| valnum = unique -# 39| v0_46(void) = ReturnValue : &:r0_45 -# 39| v0_47(void) = UnmodeledUse : mu* -# 39| v0_48(void) = ExitFunction : +# 39| v0_51(void) = ReturnValue : &:r0_50 +# 39| v0_52(void) = UnmodeledUse : mu* +# 39| v0_53(void) = ExitFunction : # 49| unsigned int my_strspn(char const*, char const*) # 49| Block 0 @@ -391,6 +419,8 @@ test.cpp: # 55| valnum = r0_7 # 55| m2_3(char *) = Store : &:r2_2, r2_1 # 55| valnum = m0_6 +# 55| r2_4(glval) = CopyValue : r2_2 +# 55| valnum = r0_7 #-----| Goto -> Block 3 # 56| Block 3 @@ -572,6 +602,8 @@ test.cpp: # 80| valnum = r0_5 # 80| m1_6(signed short) = Store : &:r1_5, r1_4 # 80| valnum = r1_4 +# 80| r1_7(glval) = CopyValue : r1_5 +# 80| valnum = r0_5 #-----| Goto -> Block 2 # 82| Block 2 @@ -648,10 +680,12 @@ test.cpp: # 88| valnum = r0_9 # 88| m3_4(int) = Store : &:r3_3, r3_2 # 88| valnum = m3_0 -# 89| v3_5(void) = NoOp : -# 84| v3_6(void) = ReturnVoid : -# 84| v3_7(void) = UnmodeledUse : mu* -# 84| v3_8(void) = ExitFunction : +# 88| r3_5(glval) = CopyValue : r3_3 +# 88| valnum = r0_9 +# 89| v3_6(void) = NoOp : +# 84| v3_7(void) = ReturnVoid : +# 84| v3_8(void) = UnmodeledUse : mu* +# 84| v3_9(void) = ExitFunction : # 91| int regression_test00() # 91| Block 0 @@ -668,21 +702,23 @@ test.cpp: # 92| valnum = r0_3 # 92| m0_6(int) = Store : &:r0_5, r0_4 # 92| valnum = r0_4 -# 92| m0_7(int) = Store : &:r0_3, r0_4 +# 92| r0_7(int) = CopyValue : r0_4 # 92| valnum = r0_4 -# 93| r0_8(glval) = VariableAddress[#return] : -# 93| valnum = r0_8 -# 93| r0_9(glval) = VariableAddress[x] : +# 92| m0_8(int) = Store : &:r0_3, r0_7 +# 92| valnum = r0_4 +# 93| r0_9(glval) = VariableAddress[#return] : +# 93| valnum = r0_9 +# 93| r0_10(glval) = VariableAddress[x] : # 93| valnum = r0_3 -# 93| r0_10(int) = Load : &:r0_9, m0_7 +# 93| r0_11(int) = Load : &:r0_10, m0_8 # 93| valnum = r0_4 -# 93| m0_11(int) = Store : &:r0_8, r0_10 +# 93| m0_12(int) = Store : &:r0_9, r0_11 # 93| valnum = r0_4 -# 91| r0_12(glval) = VariableAddress[#return] : -# 91| valnum = r0_8 -# 91| v0_13(void) = ReturnValue : &:r0_12, m0_11 -# 91| v0_14(void) = UnmodeledUse : mu* -# 91| v0_15(void) = ExitFunction : +# 91| r0_13(glval) = VariableAddress[#return] : +# 91| valnum = r0_9 +# 91| v0_14(void) = ReturnValue : &:r0_13, m0_12 +# 91| v0_15(void) = UnmodeledUse : mu* +# 91| v0_16(void) = ExitFunction : # 104| int inheritanceConversions(Derived*) # 104| Block 0