Skip to content

Commit 89c11b8

Browse files
committed
C++: Add tests for logical vector operations
1 parent 1ebf623 commit 89c11b8

11 files changed

+44
-15
lines changed

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13331,7 +13331,21 @@ ir.cpp:
1333113331
# 1216| getRightOperand(): [VariableAccess] vi4_shuffle
1333213332
# 1216| Type = [SpecifiedType] __attribute((vector_size(16UL))) int
1333313333
# 1216| ValueCategory = prvalue(load)
13334-
# 1219| getStmt(5): [ReturnStmt] return ...
13334+
# 1217| getStmt(5): [ExprStmt] ExprStmt
13335+
# 1217| getExpr(): [AssignExpr] ... = ...
13336+
# 1217| Type = [SpecifiedType] __attribute((vector_size(16UL))) int
13337+
# 1217| ValueCategory = lvalue
13338+
# 1217| getLValue(): [VariableAccess] vi4
13339+
# 1217| Type = [SpecifiedType] __attribute((vector_size(16UL))) int
13340+
# 1217| ValueCategory = lvalue
13341+
# 1218| getStmt(6): [ExprStmt] ExprStmt
13342+
# 1218| getExpr(): [AssignExpr] ... = ...
13343+
# 1218| Type = [SpecifiedType] __attribute((vector_size(16UL))) int
13344+
# 1218| ValueCategory = lvalue
13345+
# 1218| getLValue(): [VariableAccess] vi4
13346+
# 1218| Type = [SpecifiedType] __attribute((vector_size(16UL))) int
13347+
# 1218| ValueCategory = lvalue
13348+
# 1219| getStmt(7): [ReturnStmt] return ...
1333513349
# 1221| [TopLevelFunction] void* memcpy(void*, void*, int)
1333613350
# 1221| <params>:
1333713351
# 1221| getParameter(0): [Parameter] dst

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10486,10 +10486,6 @@ 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-
# 1219| v1219_1(void) = NoOp :
10490-
# 1211| v1211_7(void) = ReturnVoid :
10491-
# 1211| v1211_8(void) = AliasedUse : m1211_3
10492-
# 1211| v1211_9(void) = ExitFunction :
1049310489

1049410490
# 1223| int ModeledCallTarget(int)
1049510491
# 1223| Block 0

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ 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) |
910
ambiguousSuccessors
1011
unexplainedLoop
1112
unnecessaryPhiInstruction

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ 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) |
910
ambiguousSuccessors
1011
unexplainedLoop
1112
unnecessaryPhiInstruction

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,8 +1214,8 @@ void VectorTypes(int i) {
12141214
vi4[i] = x;
12151215
vector(4, int) vi4_shuffle = __builtin_shufflevector(vi4, vi4, 3+0, 2, 1, 0);
12161216
vi4 = vi4 + vi4_shuffle;
1217-
1218-
1217+
vi4 = vi4 && vi4_shuffle;
1218+
vi4 = vi4 || vi4_shuffle;
12191219
}
12201220

12211221
void *memcpy(void *dst, void *src, int size);

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
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) |
24
unexpectedOperand
35
duplicateOperand
46
missingPhiOperand
57
missingOperandType
68
duplicateChiOperand
79
sideEffectWithoutPrimary
810
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) |
913
ambiguousSuccessors
1014
unexplainedLoop
1115
unnecessaryPhiInstruction

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9692,10 +9692,18 @@ 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-
# 1219| v1219_1(void) = NoOp :
9696-
# 1211| v1211_6(void) = ReturnVoid :
9697-
# 1211| v1211_7(void) = AliasedUse : ~m?
9698-
# 1211| v1211_8(void) = ExitFunction :
9695+
9696+
# 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 :
96999707

97009708
# 1223| int ModeledCallTarget(int)
97019709
# 1223| Block 0

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ 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) |
910
ambiguousSuccessors
1011
unexplainedLoop
1112
unnecessaryPhiInstruction

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ 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) |
910
ambiguousSuccessors
1011
unexplainedLoop
1112
unnecessaryPhiInstruction

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,7 @@
3434
| vector_types.cpp:47:23:47:25 | dst | dst | file://:0:0:0:0 | v16i * | 8 |
3535
| vector_types.cpp:47:34:47:36 | src | src | file://:0:0:0:0 | v16i * | 8 |
3636
| vector_types.cpp:47:43:47:43 | n | n | file://:0:0:0:0 | int | 4 |
37+
| vector_types.cpp:54:20:54:22 | dst | dst | file://:0:0:0:0 | v16i * | 8 |
38+
| vector_types.cpp:54:31:54:34 | src1 | src1 | file://:0:0:0:0 | v16i * | 8 |
39+
| vector_types.cpp:54:43:54:46 | src2 | src2 | file://:0:0:0:0 | v16i * | 8 |
3740
| vector_types.cpp:62:43:62:44 | vf | vf | vector_types.cpp:60:16:60:27 | vector4float | 16 |

0 commit comments

Comments
 (0)