Skip to content

Commit 217c5cb

Browse files
committed
C++: Update tests after adding extractor support for logical vector operations
1 parent 89c11b8 commit 217c5cb

9 files changed

+164
-18
lines changed

cpp/ql/test/library-tests/ir/ir/PrintAST.expected

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13338,13 +13338,31 @@ ir.cpp:
1333813338
# 1217| getLValue(): [VariableAccess] vi4
1333913339
# 1217| Type = [SpecifiedType] __attribute((vector_size(16UL))) int
1334013340
# 1217| ValueCategory = lvalue
13341+
# 1217| getRValue(): [LogicalAndExpr] ... && ...
13342+
# 1217| Type = [GNUVectorType] __attribute((vector_size(16))) int
13343+
# 1217| ValueCategory = prvalue
13344+
# 1217| getLeftOperand(): [VariableAccess] vi4
13345+
# 1217| Type = [SpecifiedType] __attribute((vector_size(16UL))) int
13346+
# 1217| ValueCategory = prvalue(load)
13347+
# 1217| getRightOperand(): [VariableAccess] vi4_shuffle
13348+
# 1217| Type = [SpecifiedType] __attribute((vector_size(16UL))) int
13349+
# 1217| ValueCategory = prvalue(load)
1334113350
# 1218| getStmt(6): [ExprStmt] ExprStmt
1334213351
# 1218| getExpr(): [AssignExpr] ... = ...
1334313352
# 1218| Type = [SpecifiedType] __attribute((vector_size(16UL))) int
1334413353
# 1218| ValueCategory = lvalue
1334513354
# 1218| getLValue(): [VariableAccess] vi4
1334613355
# 1218| Type = [SpecifiedType] __attribute((vector_size(16UL))) int
1334713356
# 1218| ValueCategory = lvalue
13357+
# 1218| getRValue(): [LogicalOrExpr] ... || ...
13358+
# 1218| Type = [GNUVectorType] __attribute((vector_size(16))) int
13359+
# 1218| ValueCategory = prvalue
13360+
# 1218| getLeftOperand(): [VariableAccess] vi4
13361+
# 1218| Type = [SpecifiedType] __attribute((vector_size(16UL))) int
13362+
# 1218| ValueCategory = prvalue(load)
13363+
# 1218| getRightOperand(): [VariableAccess] vi4_shuffle
13364+
# 1218| Type = [SpecifiedType] __attribute((vector_size(16UL))) int
13365+
# 1218| ValueCategory = prvalue(load)
1334813366
# 1219| getStmt(7): [ReturnStmt] return ...
1334913367
# 1221| [TopLevelFunction] void* memcpy(void*, void*, int)
1335013368
# 1221| <params>:

cpp/ql/test/library-tests/ir/ir/aliased_ir.expected

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10486,6 +10486,80 @@ ir.cpp:
1048610486
# 1216| r1216_5(__attribute((vector_size(16UL))) int) = Add : r1216_2, r1216_4
1048710487
# 1216| r1216_6(glval<__attribute((vector_size(16UL))) int>) = VariableAddress[vi4] :
1048810488
# 1216| m1216_7(__attribute((vector_size(16UL))) int) = Store[vi4] : &:r1216_6, r1216_5
10489+
# 1217| r1217_1(glval<__attribute((vector_size(16UL))) int>) = VariableAddress[vi4] :
10490+
# 1217| r1217_2(__attribute((vector_size(16UL))) int) = Load[vi4] : &:r1217_1, m1216_7
10491+
# 1217| r1217_3(__attribute((vector_size(16UL))) int) = Constant[0] :
10492+
# 1217| r1217_4(bool) = CompareNE : r1217_2, r1217_3
10493+
# 1217| v1217_5(void) = ConditionalBranch : r1217_4
10494+
#-----| False -> Block 1
10495+
#-----| True -> Block 4
10496+
10497+
# 1217| Block 1
10498+
# 1217| r1217_6(glval<__attribute((vector_size(16))) int>) = VariableAddress[#temp1217:9] :
10499+
# 1217| r1217_7(__attribute((vector_size(16))) int) = Constant[0] :
10500+
# 1217| m1217_8(__attribute((vector_size(16))) int) = Store[#temp1217:9] : &:r1217_6, r1217_7
10501+
#-----| Goto -> Block 2
10502+
10503+
# 1217| Block 2
10504+
# 1217| m1217_9(__attribute((vector_size(16))) int) = Phi : from 1:m1217_8, from 3:m1217_16
10505+
# 1217| r1217_10(glval<__attribute((vector_size(16))) int>) = VariableAddress[#temp1217:9] :
10506+
# 1217| r1217_11(__attribute((vector_size(16))) int) = Load[#temp1217:9] : &:r1217_10, m1217_9
10507+
# 1217| r1217_12(glval<__attribute((vector_size(16UL))) int>) = VariableAddress[vi4] :
10508+
# 1217| m1217_13(__attribute((vector_size(16UL))) int) = Store[vi4] : &:r1217_12, r1217_11
10509+
# 1218| r1218_1(glval<__attribute((vector_size(16UL))) int>) = VariableAddress[vi4] :
10510+
# 1218| r1218_2(__attribute((vector_size(16UL))) int) = Load[vi4] : &:r1218_1, m1217_13
10511+
# 1218| r1218_3(__attribute((vector_size(16UL))) int) = Constant[0] :
10512+
# 1218| r1218_4(bool) = CompareNE : r1218_2, r1218_3
10513+
# 1218| v1218_5(void) = ConditionalBranch : r1218_4
10514+
#-----| False -> Block 8
10515+
#-----| True -> Block 7
10516+
10517+
# 1217| Block 3
10518+
# 1217| r1217_14(glval<__attribute((vector_size(16))) int>) = VariableAddress[#temp1217:9] :
10519+
# 1217| r1217_15(__attribute((vector_size(16))) int) = Constant[1] :
10520+
# 1217| m1217_16(__attribute((vector_size(16))) int) = Store[#temp1217:9] : &:r1217_14, r1217_15
10521+
#-----| Goto -> Block 2
10522+
10523+
# 1217| Block 4
10524+
# 1217| r1217_17(glval<__attribute((vector_size(16UL))) int>) = VariableAddress[vi4_shuffle] :
10525+
# 1217| r1217_18(__attribute((vector_size(16UL))) int) = Load[vi4_shuffle] : &:r1217_17, m1215_11
10526+
# 1217| r1217_19(__attribute((vector_size(16UL))) int) = Constant[0] :
10527+
# 1217| r1217_20(bool) = CompareNE : r1217_18, r1217_19
10528+
# 1217| v1217_21(void) = ConditionalBranch : r1217_20
10529+
#-----| False -> Block 1
10530+
#-----| True -> Block 3
10531+
10532+
# 1218| Block 5
10533+
# 1218| r1218_6(glval<__attribute((vector_size(16))) int>) = VariableAddress[#temp1218:9] :
10534+
# 1218| r1218_7(__attribute((vector_size(16))) int) = Constant[0] :
10535+
# 1218| m1218_8(__attribute((vector_size(16))) int) = Store[#temp1218:9] : &:r1218_6, r1218_7
10536+
#-----| Goto -> Block 6
10537+
10538+
# 1218| Block 6
10539+
# 1218| m1218_9(__attribute((vector_size(16))) int) = Phi : from 5:m1218_8, from 7:m1218_16
10540+
# 1218| r1218_10(glval<__attribute((vector_size(16))) int>) = VariableAddress[#temp1218:9] :
10541+
# 1218| r1218_11(__attribute((vector_size(16))) int) = Load[#temp1218:9] : &:r1218_10, m1218_9
10542+
# 1218| r1218_12(glval<__attribute((vector_size(16UL))) int>) = VariableAddress[vi4] :
10543+
# 1218| m1218_13(__attribute((vector_size(16UL))) int) = Store[vi4] : &:r1218_12, r1218_11
10544+
# 1219| v1219_1(void) = NoOp :
10545+
# 1211| v1211_7(void) = ReturnVoid :
10546+
# 1211| v1211_8(void) = AliasedUse : m1211_3
10547+
# 1211| v1211_9(void) = ExitFunction :
10548+
10549+
# 1218| Block 7
10550+
# 1218| r1218_14(glval<__attribute((vector_size(16))) int>) = VariableAddress[#temp1218:9] :
10551+
# 1218| r1218_15(__attribute((vector_size(16))) int) = Constant[1] :
10552+
# 1218| m1218_16(__attribute((vector_size(16))) int) = Store[#temp1218:9] : &:r1218_14, r1218_15
10553+
#-----| Goto -> Block 6
10554+
10555+
# 1218| Block 8
10556+
# 1218| r1218_17(glval<__attribute((vector_size(16UL))) int>) = VariableAddress[vi4_shuffle] :
10557+
# 1218| r1218_18(__attribute((vector_size(16UL))) int) = Load[vi4_shuffle] : &:r1218_17, m1215_11
10558+
# 1218| r1218_19(__attribute((vector_size(16UL))) int) = Constant[0] :
10559+
# 1218| r1218_20(bool) = CompareNE : r1218_18, r1218_19
10560+
# 1218| v1218_21(void) = ConditionalBranch : r1218_20
10561+
#-----| False -> Block 5
10562+
#-----| True -> Block 7
1048910563

1049010564
# 1223| int ModeledCallTarget(int)
1049110565
# 1223| Block 0

cpp/ql/test/library-tests/ir/ir/aliased_ssa_consistency.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ missingOperandType
66
duplicateChiOperand
77
sideEffectWithoutPrimary
88
instructionWithoutSuccessor
9-
| 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) |
109
ambiguousSuccessors
1110
unexplainedLoop
1211
unnecessaryPhiInstruction

cpp/ql/test/library-tests/ir/ir/aliased_ssa_consistency_unsound.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ missingOperandType
66
duplicateChiOperand
77
sideEffectWithoutPrimary
88
instructionWithoutSuccessor
9-
| 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) |
109
ambiguousSuccessors
1110
unexplainedLoop
1211
unnecessaryPhiInstruction

cpp/ql/test/library-tests/ir/ir/raw_consistency.expected

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
missingOperand
2-
| 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) |
3-
| 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) |
42
unexpectedOperand
53
duplicateOperand
64
missingPhiOperand
75
missingOperandType
86
duplicateChiOperand
97
sideEffectWithoutPrimary
108
instructionWithoutSuccessor
11-
| 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) |
12-
| 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) |
139
ambiguousSuccessors
1410
unexplainedLoop
1511
unnecessaryPhiInstruction

cpp/ql/test/library-tests/ir/ir/raw_ir.expected

Lines changed: 70 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9692,18 +9692,78 @@ ir.cpp:
96929692
# 1216| r1216_5(__attribute((vector_size(16UL))) int) = Add : r1216_2, r1216_4
96939693
# 1216| r1216_6(glval<__attribute((vector_size(16UL))) int>) = VariableAddress[vi4] :
96949694
# 1216| mu1216_7(__attribute((vector_size(16UL))) int) = Store[vi4] : &:r1216_6, r1216_5
9695+
# 1217| r1217_1(glval<__attribute((vector_size(16UL))) int>) = VariableAddress[vi4] :
9696+
# 1217| r1217_2(__attribute((vector_size(16UL))) int) = Load[vi4] : &:r1217_1, ~m?
9697+
# 1217| r1217_3(__attribute((vector_size(16UL))) int) = Constant[0] :
9698+
# 1217| r1217_4(bool) = CompareNE : r1217_2, r1217_3
9699+
# 1217| v1217_5(void) = ConditionalBranch : r1217_4
9700+
#-----| False -> Block 1
9701+
#-----| True -> Block 4
96959702

96969703
# 1217| Block 1
9697-
# 1217| r1217_1(glval<__attribute((vector_size(16UL))) int>) = VariableAddress[vi4] :
9698-
# 1217| mu1217_2(__attribute((vector_size(16UL))) int) = Store[vi4] : &:r1217_1
9699-
9700-
# 1218| Block 2
9701-
# 1218| r1218_1(glval<__attribute((vector_size(16UL))) int>) = VariableAddress[vi4] :
9702-
# 1218| mu1218_2(__attribute((vector_size(16UL))) int) = Store[vi4] : &:r1218_1
9703-
# 1219| v1219_1(void) = NoOp :
9704-
# 1211| v1211_6(void) = ReturnVoid :
9705-
# 1211| v1211_7(void) = AliasedUse : ~m?
9706-
# 1211| v1211_8(void) = ExitFunction :
9704+
# 1217| r1217_6(glval<__attribute((vector_size(16))) int>) = VariableAddress[#temp1217:9] :
9705+
# 1217| r1217_7(__attribute((vector_size(16))) int) = Constant[0] :
9706+
# 1217| mu1217_8(__attribute((vector_size(16))) int) = Store[#temp1217:9] : &:r1217_6, r1217_7
9707+
#-----| Goto -> Block 2
9708+
9709+
# 1217| Block 2
9710+
# 1217| r1217_9(glval<__attribute((vector_size(16))) int>) = VariableAddress[#temp1217:9] :
9711+
# 1217| r1217_10(__attribute((vector_size(16))) int) = Load[#temp1217:9] : &:r1217_9, ~m?
9712+
# 1217| r1217_11(glval<__attribute((vector_size(16UL))) int>) = VariableAddress[vi4] :
9713+
# 1217| mu1217_12(__attribute((vector_size(16UL))) int) = Store[vi4] : &:r1217_11, r1217_10
9714+
# 1218| r1218_1(glval<__attribute((vector_size(16UL))) int>) = VariableAddress[vi4] :
9715+
# 1218| r1218_2(__attribute((vector_size(16UL))) int) = Load[vi4] : &:r1218_1, ~m?
9716+
# 1218| r1218_3(__attribute((vector_size(16UL))) int) = Constant[0] :
9717+
# 1218| r1218_4(bool) = CompareNE : r1218_2, r1218_3
9718+
# 1218| v1218_5(void) = ConditionalBranch : r1218_4
9719+
#-----| False -> Block 8
9720+
#-----| True -> Block 7
9721+
9722+
# 1217| Block 3
9723+
# 1217| r1217_13(glval<__attribute((vector_size(16))) int>) = VariableAddress[#temp1217:9] :
9724+
# 1217| r1217_14(__attribute((vector_size(16))) int) = Constant[1] :
9725+
# 1217| mu1217_15(__attribute((vector_size(16))) int) = Store[#temp1217:9] : &:r1217_13, r1217_14
9726+
#-----| Goto -> Block 2
9727+
9728+
# 1217| Block 4
9729+
# 1217| r1217_16(glval<__attribute((vector_size(16UL))) int>) = VariableAddress[vi4_shuffle] :
9730+
# 1217| r1217_17(__attribute((vector_size(16UL))) int) = Load[vi4_shuffle] : &:r1217_16, ~m?
9731+
# 1217| r1217_18(__attribute((vector_size(16UL))) int) = Constant[0] :
9732+
# 1217| r1217_19(bool) = CompareNE : r1217_17, r1217_18
9733+
# 1217| v1217_20(void) = ConditionalBranch : r1217_19
9734+
#-----| False -> Block 1
9735+
#-----| True -> Block 3
9736+
9737+
# 1218| Block 5
9738+
# 1218| r1218_6(glval<__attribute((vector_size(16))) int>) = VariableAddress[#temp1218:9] :
9739+
# 1218| r1218_7(__attribute((vector_size(16))) int) = Constant[0] :
9740+
# 1218| mu1218_8(__attribute((vector_size(16))) int) = Store[#temp1218:9] : &:r1218_6, r1218_7
9741+
#-----| Goto -> Block 6
9742+
9743+
# 1218| Block 6
9744+
# 1218| r1218_9(glval<__attribute((vector_size(16))) int>) = VariableAddress[#temp1218:9] :
9745+
# 1218| r1218_10(__attribute((vector_size(16))) int) = Load[#temp1218:9] : &:r1218_9, ~m?
9746+
# 1218| r1218_11(glval<__attribute((vector_size(16UL))) int>) = VariableAddress[vi4] :
9747+
# 1218| mu1218_12(__attribute((vector_size(16UL))) int) = Store[vi4] : &:r1218_11, r1218_10
9748+
# 1219| v1219_1(void) = NoOp :
9749+
# 1211| v1211_6(void) = ReturnVoid :
9750+
# 1211| v1211_7(void) = AliasedUse : ~m?
9751+
# 1211| v1211_8(void) = ExitFunction :
9752+
9753+
# 1218| Block 7
9754+
# 1218| r1218_13(glval<__attribute((vector_size(16))) int>) = VariableAddress[#temp1218:9] :
9755+
# 1218| r1218_14(__attribute((vector_size(16))) int) = Constant[1] :
9756+
# 1218| mu1218_15(__attribute((vector_size(16))) int) = Store[#temp1218:9] : &:r1218_13, r1218_14
9757+
#-----| Goto -> Block 6
9758+
9759+
# 1218| Block 8
9760+
# 1218| r1218_16(glval<__attribute((vector_size(16UL))) int>) = VariableAddress[vi4_shuffle] :
9761+
# 1218| r1218_17(__attribute((vector_size(16UL))) int) = Load[vi4_shuffle] : &:r1218_16, ~m?
9762+
# 1218| r1218_18(__attribute((vector_size(16UL))) int) = Constant[0] :
9763+
# 1218| r1218_19(bool) = CompareNE : r1218_17, r1218_18
9764+
# 1218| v1218_20(void) = ConditionalBranch : r1218_19
9765+
#-----| False -> Block 5
9766+
#-----| True -> Block 7
97079767

97089768
# 1223| int ModeledCallTarget(int)
97099769
# 1223| Block 0

cpp/ql/test/library-tests/ir/ir/unaliased_ssa_consistency.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ missingOperandType
66
duplicateChiOperand
77
sideEffectWithoutPrimary
88
instructionWithoutSuccessor
9-
| 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) |
109
ambiguousSuccessors
1110
unexplainedLoop
1211
unnecessaryPhiInstruction

cpp/ql/test/library-tests/ir/ir/unaliased_ssa_consistency_unsound.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ missingOperandType
66
duplicateChiOperand
77
sideEffectWithoutPrimary
88
instructionWithoutSuccessor
9-
| 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) |
109
ambiguousSuccessors
1110
unexplainedLoop
1211
unnecessaryPhiInstruction

cpp/ql/test/library-tests/vector_types/vector_ops.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
| vector_types.cpp:21:10:21:18 | ... < ... | < | file://:0:0:0:0 | __attribute((vector_size(16))) int |
33
| vector_types.cpp:51:10:51:18 | ... << ... | << | file://:0:0:0:0 | __attribute((vector_size(16))) int |
44
| vector_types.cpp:51:18:51:18 | (vector fill) ... | (vector fill) | file://:0:0:0:0 | __attribute((vector_size(16))) int |
5+
| vector_types.cpp:55:10:55:23 | ... && ... | && | file://:0:0:0:0 | __attribute((vector_size(16))) int |
6+
| vector_types.cpp:56:10:56:23 | ... \|\| ... | \|\| | file://:0:0:0:0 | __attribute((vector_size(16))) int |

0 commit comments

Comments
 (0)