From 217c5cb78bc02d45bf358a7362c2e28023dcc009 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Thu, 8 Jan 2026 11:20:23 +0100 Subject: [PATCH] C++: Update tests after adding extractor support for logical vector operations --- .../library-tests/ir/ir/PrintAST.expected | 18 +++++ .../library-tests/ir/ir/aliased_ir.expected | 74 ++++++++++++++++++ .../ir/ir/aliased_ssa_consistency.expected | 1 - .../aliased_ssa_consistency_unsound.expected | 1 - .../ir/ir/raw_consistency.expected | 4 - .../test/library-tests/ir/ir/raw_ir.expected | 78 ++++++++++++++++--- .../ir/ir/unaliased_ssa_consistency.expected | 1 - ...unaliased_ssa_consistency_unsound.expected | 1 - .../vector_types/vector_ops.expected | 2 + 9 files changed, 163 insertions(+), 17 deletions(-) diff --git a/cpp/ql/test/library-tests/ir/ir/PrintAST.expected b/cpp/ql/test/library-tests/ir/ir/PrintAST.expected index c544d01794b..e6f88ceb778 100644 --- a/cpp/ql/test/library-tests/ir/ir/PrintAST.expected +++ b/cpp/ql/test/library-tests/ir/ir/PrintAST.expected @@ -13338,6 +13338,15 @@ ir.cpp: # 1217| getLValue(): [VariableAccess] vi4 # 1217| Type = [SpecifiedType] __attribute((vector_size(16UL))) int # 1217| ValueCategory = lvalue +# 1217| getRValue(): [LogicalAndExpr] ... && ... +# 1217| Type = [GNUVectorType] __attribute((vector_size(16))) int +# 1217| ValueCategory = prvalue +# 1217| getLeftOperand(): [VariableAccess] vi4 +# 1217| Type = [SpecifiedType] __attribute((vector_size(16UL))) int +# 1217| ValueCategory = prvalue(load) +# 1217| getRightOperand(): [VariableAccess] vi4_shuffle +# 1217| Type = [SpecifiedType] __attribute((vector_size(16UL))) int +# 1217| ValueCategory = prvalue(load) # 1218| getStmt(6): [ExprStmt] ExprStmt # 1218| getExpr(): [AssignExpr] ... = ... # 1218| Type = [SpecifiedType] __attribute((vector_size(16UL))) int @@ -13345,6 +13354,15 @@ ir.cpp: # 1218| getLValue(): [VariableAccess] vi4 # 1218| Type = [SpecifiedType] __attribute((vector_size(16UL))) int # 1218| ValueCategory = lvalue +# 1218| getRValue(): [LogicalOrExpr] ... || ... +# 1218| Type = [GNUVectorType] __attribute((vector_size(16))) int +# 1218| ValueCategory = prvalue +# 1218| getLeftOperand(): [VariableAccess] vi4 +# 1218| Type = [SpecifiedType] __attribute((vector_size(16UL))) int +# 1218| ValueCategory = prvalue(load) +# 1218| getRightOperand(): [VariableAccess] vi4_shuffle +# 1218| Type = [SpecifiedType] __attribute((vector_size(16UL))) int +# 1218| ValueCategory = prvalue(load) # 1219| getStmt(7): [ReturnStmt] return ... # 1221| [TopLevelFunction] void* memcpy(void*, void*, int) # 1221| : diff --git a/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected b/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected index b7f7d598348..94daf808a72 100644 --- a/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected +++ b/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected @@ -10486,6 +10486,80 @@ ir.cpp: # 1216| r1216_5(__attribute((vector_size(16UL))) int) = Add : r1216_2, r1216_4 # 1216| r1216_6(glval<__attribute((vector_size(16UL))) int>) = VariableAddress[vi4] : # 1216| m1216_7(__attribute((vector_size(16UL))) int) = Store[vi4] : &:r1216_6, r1216_5 +# 1217| r1217_1(glval<__attribute((vector_size(16UL))) int>) = VariableAddress[vi4] : +# 1217| r1217_2(__attribute((vector_size(16UL))) int) = Load[vi4] : &:r1217_1, m1216_7 +# 1217| r1217_3(__attribute((vector_size(16UL))) int) = Constant[0] : +# 1217| r1217_4(bool) = CompareNE : r1217_2, r1217_3 +# 1217| v1217_5(void) = ConditionalBranch : r1217_4 +#-----| False -> Block 1 +#-----| True -> Block 4 + +# 1217| Block 1 +# 1217| r1217_6(glval<__attribute((vector_size(16))) int>) = VariableAddress[#temp1217:9] : +# 1217| r1217_7(__attribute((vector_size(16))) int) = Constant[0] : +# 1217| m1217_8(__attribute((vector_size(16))) int) = Store[#temp1217:9] : &:r1217_6, r1217_7 +#-----| Goto -> Block 2 + +# 1217| Block 2 +# 1217| m1217_9(__attribute((vector_size(16))) int) = Phi : from 1:m1217_8, from 3:m1217_16 +# 1217| r1217_10(glval<__attribute((vector_size(16))) int>) = VariableAddress[#temp1217:9] : +# 1217| r1217_11(__attribute((vector_size(16))) int) = Load[#temp1217:9] : &:r1217_10, m1217_9 +# 1217| r1217_12(glval<__attribute((vector_size(16UL))) int>) = VariableAddress[vi4] : +# 1217| m1217_13(__attribute((vector_size(16UL))) int) = Store[vi4] : &:r1217_12, r1217_11 +# 1218| r1218_1(glval<__attribute((vector_size(16UL))) int>) = VariableAddress[vi4] : +# 1218| r1218_2(__attribute((vector_size(16UL))) int) = Load[vi4] : &:r1218_1, m1217_13 +# 1218| r1218_3(__attribute((vector_size(16UL))) int) = Constant[0] : +# 1218| r1218_4(bool) = CompareNE : r1218_2, r1218_3 +# 1218| v1218_5(void) = ConditionalBranch : r1218_4 +#-----| False -> Block 8 +#-----| True -> Block 7 + +# 1217| Block 3 +# 1217| r1217_14(glval<__attribute((vector_size(16))) int>) = VariableAddress[#temp1217:9] : +# 1217| r1217_15(__attribute((vector_size(16))) int) = Constant[1] : +# 1217| m1217_16(__attribute((vector_size(16))) int) = Store[#temp1217:9] : &:r1217_14, r1217_15 +#-----| Goto -> Block 2 + +# 1217| Block 4 +# 1217| r1217_17(glval<__attribute((vector_size(16UL))) int>) = VariableAddress[vi4_shuffle] : +# 1217| r1217_18(__attribute((vector_size(16UL))) int) = Load[vi4_shuffle] : &:r1217_17, m1215_11 +# 1217| r1217_19(__attribute((vector_size(16UL))) int) = Constant[0] : +# 1217| r1217_20(bool) = CompareNE : r1217_18, r1217_19 +# 1217| v1217_21(void) = ConditionalBranch : r1217_20 +#-----| False -> Block 1 +#-----| True -> Block 3 + +# 1218| Block 5 +# 1218| r1218_6(glval<__attribute((vector_size(16))) int>) = VariableAddress[#temp1218:9] : +# 1218| r1218_7(__attribute((vector_size(16))) int) = Constant[0] : +# 1218| m1218_8(__attribute((vector_size(16))) int) = Store[#temp1218:9] : &:r1218_6, r1218_7 +#-----| Goto -> Block 6 + +# 1218| Block 6 +# 1218| m1218_9(__attribute((vector_size(16))) int) = Phi : from 5:m1218_8, from 7:m1218_16 +# 1218| r1218_10(glval<__attribute((vector_size(16))) int>) = VariableAddress[#temp1218:9] : +# 1218| r1218_11(__attribute((vector_size(16))) int) = Load[#temp1218:9] : &:r1218_10, m1218_9 +# 1218| r1218_12(glval<__attribute((vector_size(16UL))) int>) = VariableAddress[vi4] : +# 1218| m1218_13(__attribute((vector_size(16UL))) int) = Store[vi4] : &:r1218_12, r1218_11 +# 1219| v1219_1(void) = NoOp : +# 1211| v1211_7(void) = ReturnVoid : +# 1211| v1211_8(void) = AliasedUse : m1211_3 +# 1211| v1211_9(void) = ExitFunction : + +# 1218| Block 7 +# 1218| r1218_14(glval<__attribute((vector_size(16))) int>) = VariableAddress[#temp1218:9] : +# 1218| r1218_15(__attribute((vector_size(16))) int) = Constant[1] : +# 1218| m1218_16(__attribute((vector_size(16))) int) = Store[#temp1218:9] : &:r1218_14, r1218_15 +#-----| Goto -> Block 6 + +# 1218| Block 8 +# 1218| r1218_17(glval<__attribute((vector_size(16UL))) int>) = VariableAddress[vi4_shuffle] : +# 1218| r1218_18(__attribute((vector_size(16UL))) int) = Load[vi4_shuffle] : &:r1218_17, m1215_11 +# 1218| r1218_19(__attribute((vector_size(16UL))) int) = Constant[0] : +# 1218| r1218_20(bool) = CompareNE : r1218_18, r1218_19 +# 1218| v1218_21(void) = ConditionalBranch : r1218_20 +#-----| False -> Block 5 +#-----| True -> Block 7 # 1223| int ModeledCallTarget(int) # 1223| Block 0 diff --git a/cpp/ql/test/library-tests/ir/ir/aliased_ssa_consistency.expected b/cpp/ql/test/library-tests/ir/ir/aliased_ssa_consistency.expected index 3bbce2b470a..f1b75895c3e 100644 --- a/cpp/ql/test/library-tests/ir/ir/aliased_ssa_consistency.expected +++ b/cpp/ql/test/library-tests/ir/ir/aliased_ssa_consistency.expected @@ -6,7 +6,6 @@ missingOperandType duplicateChiOperand sideEffectWithoutPrimary instructionWithoutSuccessor -| ir.cpp:1216:3:1216:25 | Store: ... = ... | Instruction 'Store: ... = ...' has no successors in function '$@'. | ir.cpp:1211:6:1211:16 | void VectorTypes(int) | void VectorTypes(int) | ambiguousSuccessors unexplainedLoop unnecessaryPhiInstruction diff --git a/cpp/ql/test/library-tests/ir/ir/aliased_ssa_consistency_unsound.expected b/cpp/ql/test/library-tests/ir/ir/aliased_ssa_consistency_unsound.expected index 3bbce2b470a..f1b75895c3e 100644 --- a/cpp/ql/test/library-tests/ir/ir/aliased_ssa_consistency_unsound.expected +++ b/cpp/ql/test/library-tests/ir/ir/aliased_ssa_consistency_unsound.expected @@ -6,7 +6,6 @@ missingOperandType duplicateChiOperand sideEffectWithoutPrimary instructionWithoutSuccessor -| ir.cpp:1216:3:1216:25 | Store: ... = ... | Instruction 'Store: ... = ...' has no successors in function '$@'. | ir.cpp:1211:6:1211:16 | void VectorTypes(int) | void VectorTypes(int) | ambiguousSuccessors unexplainedLoop unnecessaryPhiInstruction diff --git a/cpp/ql/test/library-tests/ir/ir/raw_consistency.expected b/cpp/ql/test/library-tests/ir/ir/raw_consistency.expected index b1965792181..de43ad9631a 100644 --- a/cpp/ql/test/library-tests/ir/ir/raw_consistency.expected +++ b/cpp/ql/test/library-tests/ir/ir/raw_consistency.expected @@ -1,6 +1,4 @@ missingOperand -| ir.cpp:1217:3:1217:26 | Store: ... = ... | Instruction 'Store' is missing an expected operand with tag 'StoreValue' in function '$@'. | ir.cpp:1211:6:1211:16 | void VectorTypes(int) | void VectorTypes(int) | -| ir.cpp:1218:3:1218:26 | Store: ... = ... | Instruction 'Store' is missing an expected operand with tag 'StoreValue' in function '$@'. | ir.cpp:1211:6:1211:16 | void VectorTypes(int) | void VectorTypes(int) | unexpectedOperand duplicateOperand missingPhiOperand @@ -8,8 +6,6 @@ missingOperandType duplicateChiOperand sideEffectWithoutPrimary instructionWithoutSuccessor -| ir.cpp:1216:3:1216:25 | Store: ... = ... | Instruction 'Store: ... = ...' has no successors in function '$@'. | ir.cpp:1211:6:1211:16 | void VectorTypes(int) | void VectorTypes(int) | -| ir.cpp:1217:3:1217:26 | Store: ... = ... | Instruction 'Store: ... = ...' has no successors in function '$@'. | ir.cpp:1211:6:1211:16 | void VectorTypes(int) | void VectorTypes(int) | ambiguousSuccessors unexplainedLoop unnecessaryPhiInstruction diff --git a/cpp/ql/test/library-tests/ir/ir/raw_ir.expected b/cpp/ql/test/library-tests/ir/ir/raw_ir.expected index 44a97e35cf5..94e18abb9df 100644 --- a/cpp/ql/test/library-tests/ir/ir/raw_ir.expected +++ b/cpp/ql/test/library-tests/ir/ir/raw_ir.expected @@ -9692,18 +9692,78 @@ ir.cpp: # 1216| r1216_5(__attribute((vector_size(16UL))) int) = Add : r1216_2, r1216_4 # 1216| r1216_6(glval<__attribute((vector_size(16UL))) int>) = VariableAddress[vi4] : # 1216| mu1216_7(__attribute((vector_size(16UL))) int) = Store[vi4] : &:r1216_6, r1216_5 +# 1217| r1217_1(glval<__attribute((vector_size(16UL))) int>) = VariableAddress[vi4] : +# 1217| r1217_2(__attribute((vector_size(16UL))) int) = Load[vi4] : &:r1217_1, ~m? +# 1217| r1217_3(__attribute((vector_size(16UL))) int) = Constant[0] : +# 1217| r1217_4(bool) = CompareNE : r1217_2, r1217_3 +# 1217| v1217_5(void) = ConditionalBranch : r1217_4 +#-----| False -> Block 1 +#-----| True -> Block 4 # 1217| Block 1 -# 1217| r1217_1(glval<__attribute((vector_size(16UL))) int>) = VariableAddress[vi4] : -# 1217| mu1217_2(__attribute((vector_size(16UL))) int) = Store[vi4] : &:r1217_1 +# 1217| r1217_6(glval<__attribute((vector_size(16))) int>) = VariableAddress[#temp1217:9] : +# 1217| r1217_7(__attribute((vector_size(16))) int) = Constant[0] : +# 1217| mu1217_8(__attribute((vector_size(16))) int) = Store[#temp1217:9] : &:r1217_6, r1217_7 +#-----| Goto -> Block 2 -# 1218| Block 2 -# 1218| r1218_1(glval<__attribute((vector_size(16UL))) int>) = VariableAddress[vi4] : -# 1218| mu1218_2(__attribute((vector_size(16UL))) int) = Store[vi4] : &:r1218_1 -# 1219| v1219_1(void) = NoOp : -# 1211| v1211_6(void) = ReturnVoid : -# 1211| v1211_7(void) = AliasedUse : ~m? -# 1211| v1211_8(void) = ExitFunction : +# 1217| Block 2 +# 1217| r1217_9(glval<__attribute((vector_size(16))) int>) = VariableAddress[#temp1217:9] : +# 1217| r1217_10(__attribute((vector_size(16))) int) = Load[#temp1217:9] : &:r1217_9, ~m? +# 1217| r1217_11(glval<__attribute((vector_size(16UL))) int>) = VariableAddress[vi4] : +# 1217| mu1217_12(__attribute((vector_size(16UL))) int) = Store[vi4] : &:r1217_11, r1217_10 +# 1218| r1218_1(glval<__attribute((vector_size(16UL))) int>) = VariableAddress[vi4] : +# 1218| r1218_2(__attribute((vector_size(16UL))) int) = Load[vi4] : &:r1218_1, ~m? +# 1218| r1218_3(__attribute((vector_size(16UL))) int) = Constant[0] : +# 1218| r1218_4(bool) = CompareNE : r1218_2, r1218_3 +# 1218| v1218_5(void) = ConditionalBranch : r1218_4 +#-----| False -> Block 8 +#-----| True -> Block 7 + +# 1217| Block 3 +# 1217| r1217_13(glval<__attribute((vector_size(16))) int>) = VariableAddress[#temp1217:9] : +# 1217| r1217_14(__attribute((vector_size(16))) int) = Constant[1] : +# 1217| mu1217_15(__attribute((vector_size(16))) int) = Store[#temp1217:9] : &:r1217_13, r1217_14 +#-----| Goto -> Block 2 + +# 1217| Block 4 +# 1217| r1217_16(glval<__attribute((vector_size(16UL))) int>) = VariableAddress[vi4_shuffle] : +# 1217| r1217_17(__attribute((vector_size(16UL))) int) = Load[vi4_shuffle] : &:r1217_16, ~m? +# 1217| r1217_18(__attribute((vector_size(16UL))) int) = Constant[0] : +# 1217| r1217_19(bool) = CompareNE : r1217_17, r1217_18 +# 1217| v1217_20(void) = ConditionalBranch : r1217_19 +#-----| False -> Block 1 +#-----| True -> Block 3 + +# 1218| Block 5 +# 1218| r1218_6(glval<__attribute((vector_size(16))) int>) = VariableAddress[#temp1218:9] : +# 1218| r1218_7(__attribute((vector_size(16))) int) = Constant[0] : +# 1218| mu1218_8(__attribute((vector_size(16))) int) = Store[#temp1218:9] : &:r1218_6, r1218_7 +#-----| Goto -> Block 6 + +# 1218| Block 6 +# 1218| r1218_9(glval<__attribute((vector_size(16))) int>) = VariableAddress[#temp1218:9] : +# 1218| r1218_10(__attribute((vector_size(16))) int) = Load[#temp1218:9] : &:r1218_9, ~m? +# 1218| r1218_11(glval<__attribute((vector_size(16UL))) int>) = VariableAddress[vi4] : +# 1218| mu1218_12(__attribute((vector_size(16UL))) int) = Store[vi4] : &:r1218_11, r1218_10 +# 1219| v1219_1(void) = NoOp : +# 1211| v1211_6(void) = ReturnVoid : +# 1211| v1211_7(void) = AliasedUse : ~m? +# 1211| v1211_8(void) = ExitFunction : + +# 1218| Block 7 +# 1218| r1218_13(glval<__attribute((vector_size(16))) int>) = VariableAddress[#temp1218:9] : +# 1218| r1218_14(__attribute((vector_size(16))) int) = Constant[1] : +# 1218| mu1218_15(__attribute((vector_size(16))) int) = Store[#temp1218:9] : &:r1218_13, r1218_14 +#-----| Goto -> Block 6 + +# 1218| Block 8 +# 1218| r1218_16(glval<__attribute((vector_size(16UL))) int>) = VariableAddress[vi4_shuffle] : +# 1218| r1218_17(__attribute((vector_size(16UL))) int) = Load[vi4_shuffle] : &:r1218_16, ~m? +# 1218| r1218_18(__attribute((vector_size(16UL))) int) = Constant[0] : +# 1218| r1218_19(bool) = CompareNE : r1218_17, r1218_18 +# 1218| v1218_20(void) = ConditionalBranch : r1218_19 +#-----| False -> Block 5 +#-----| True -> Block 7 # 1223| int ModeledCallTarget(int) # 1223| Block 0 diff --git a/cpp/ql/test/library-tests/ir/ir/unaliased_ssa_consistency.expected b/cpp/ql/test/library-tests/ir/ir/unaliased_ssa_consistency.expected index 3bbce2b470a..f1b75895c3e 100644 --- a/cpp/ql/test/library-tests/ir/ir/unaliased_ssa_consistency.expected +++ b/cpp/ql/test/library-tests/ir/ir/unaliased_ssa_consistency.expected @@ -6,7 +6,6 @@ missingOperandType duplicateChiOperand sideEffectWithoutPrimary instructionWithoutSuccessor -| ir.cpp:1216:3:1216:25 | Store: ... = ... | Instruction 'Store: ... = ...' has no successors in function '$@'. | ir.cpp:1211:6:1211:16 | void VectorTypes(int) | void VectorTypes(int) | ambiguousSuccessors unexplainedLoop unnecessaryPhiInstruction diff --git a/cpp/ql/test/library-tests/ir/ir/unaliased_ssa_consistency_unsound.expected b/cpp/ql/test/library-tests/ir/ir/unaliased_ssa_consistency_unsound.expected index 3bbce2b470a..f1b75895c3e 100644 --- a/cpp/ql/test/library-tests/ir/ir/unaliased_ssa_consistency_unsound.expected +++ b/cpp/ql/test/library-tests/ir/ir/unaliased_ssa_consistency_unsound.expected @@ -6,7 +6,6 @@ missingOperandType duplicateChiOperand sideEffectWithoutPrimary instructionWithoutSuccessor -| ir.cpp:1216:3:1216:25 | Store: ... = ... | Instruction 'Store: ... = ...' has no successors in function '$@'. | ir.cpp:1211:6:1211:16 | void VectorTypes(int) | void VectorTypes(int) | ambiguousSuccessors unexplainedLoop unnecessaryPhiInstruction diff --git a/cpp/ql/test/library-tests/vector_types/vector_ops.expected b/cpp/ql/test/library-tests/vector_types/vector_ops.expected index 376457b88c8..7c08015a94a 100644 --- a/cpp/ql/test/library-tests/vector_types/vector_ops.expected +++ b/cpp/ql/test/library-tests/vector_types/vector_ops.expected @@ -2,3 +2,5 @@ | vector_types.cpp:21:10:21:18 | ... < ... | < | file://:0:0:0:0 | __attribute((vector_size(16))) int | | vector_types.cpp:51:10:51:18 | ... << ... | << | file://:0:0:0:0 | __attribute((vector_size(16))) int | | vector_types.cpp:51:18:51:18 | (vector fill) ... | (vector fill) | file://:0:0:0:0 | __attribute((vector_size(16))) int | +| vector_types.cpp:55:10:55:23 | ... && ... | && | file://:0:0:0:0 | __attribute((vector_size(16))) int | +| vector_types.cpp:56:10:56:23 | ... \|\| ... | \|\| | file://:0:0:0:0 | __attribute((vector_size(16))) int |