File tree Expand file tree Collapse file tree 4 files changed +40
-11
lines changed
cpp/ql/test/library-tests/ir/ir Expand file tree Collapse file tree 4 files changed +40
-11
lines changed Original file line number Diff line number Diff line change @@ -4932,7 +4932,20 @@ ir.c:
4932
4932
# 103| Type = [IntType] int
4933
4933
# 103| ValueCategory = prvalue(load)
4934
4934
# 103| getThen(): [BlockStmt] { ... }
4935
- # 104| getStmt(16): [ReturnStmt] return ...
4935
+ # 105| getStmt(16): [DeclStmt] declaration
4936
+ # 105| getDeclarationEntry(0): [VariableDeclarationEntry] definition of double_negation
4937
+ # 105| Type = [IntType] int
4938
+ # 105| getVariable().getInitializer(): [Initializer] initializer for double_negation
4939
+ # 105| getExpr(): [NotExpr] ! ...
4940
+ # 105| Type = [IntType] int
4941
+ # 105| ValueCategory = prvalue
4942
+ # 105| getOperand(): [NotExpr] ! ...
4943
+ # 105| Type = [IntType] int
4944
+ # 105| ValueCategory = prvalue
4945
+ # 105| getOperand(): [VariableAccess] x1
4946
+ # 105| Type = [IntType] int
4947
+ # 105| ValueCategory = prvalue(load)
4948
+ # 106| getStmt(17): [ReturnStmt] return ...
4936
4949
ir.cpp:
4937
4950
# 1| [TopLevelFunction] void Constants()
4938
4951
# 1| <params>:
Original file line number Diff line number Diff line change @@ -3969,11 +3969,18 @@ ir.c:
3969
3969
# 103| v103_6(void) = NoOp :
3970
3970
#-----| Goto -> Block 40
3971
3971
3972
- # 104| Block 40
3973
- # 104| v104_1(void) = NoOp :
3974
- # 84| v84_9(void) = ReturnVoid :
3975
- # 84| v84_10(void) = AliasedUse : m84_3
3976
- # 84| v84_11(void) = ExitFunction :
3972
+ # 105| Block 40
3973
+ # 105| r105_1(glval<int>) = VariableAddress[double_negation] :
3974
+ # 105| r105_2(glval<int>) = VariableAddress[x1] :
3975
+ # 105| r105_3(int) = Load[x1] : &:r105_2, m84_6
3976
+ # 105| r105_4(int) = Constant[0] :
3977
+ # 105| r105_5(bool) = CompareEQ : r105_3, r105_4
3978
+ # 105| r105_6(bool) = LogicalNot : r105_5
3979
+ # 105| m105_7(int) = Store[double_negation] : &:r105_1, r105_6
3980
+ # 106| v106_1(void) = NoOp :
3981
+ # 84| v84_9(void) = ReturnVoid :
3982
+ # 84| v84_10(void) = AliasedUse : m84_3
3983
+ # 84| v84_11(void) = ExitFunction :
3977
3984
3978
3985
ir.cpp:
3979
3986
# 1| void Constants()
Original file line number Diff line number Diff line change @@ -101,6 +101,8 @@ void branch_on_integral_in_c(int x1, int x2) {
101
101
int x_1_and_2 = x1 && x2 ;
102
102
if (x_1_and_2 ) {}
103
103
if (!x_1_and_2 ) {}
104
+
105
+ int double_negation = !!x1 ;
104
106
}
105
107
106
108
// semmle-extractor-options: --microsoft
Original file line number Diff line number Diff line change @@ -3605,11 +3605,18 @@ ir.c:
3605
3605
# 103| v103_6(void) = NoOp :
3606
3606
#-----| Goto -> Block 40
3607
3607
3608
- # 104| Block 40
3609
- # 104| v104_1(void) = NoOp :
3610
- # 84| v84_8(void) = ReturnVoid :
3611
- # 84| v84_9(void) = AliasedUse : ~m?
3612
- # 84| v84_10(void) = ExitFunction :
3608
+ # 105| Block 40
3609
+ # 105| r105_1(glval<int>) = VariableAddress[double_negation] :
3610
+ # 105| r105_2(glval<int>) = VariableAddress[x1] :
3611
+ # 105| r105_3(int) = Load[x1] : &:r105_2, ~m?
3612
+ # 105| r105_4(int) = Constant[0] :
3613
+ # 105| r105_5(bool) = CompareEQ : r105_3, r105_4
3614
+ # 105| r105_6(bool) = LogicalNot : r105_5
3615
+ # 105| mu105_7(int) = Store[double_negation] : &:r105_1, r105_6
3616
+ # 106| v106_1(void) = NoOp :
3617
+ # 84| v84_8(void) = ReturnVoid :
3618
+ # 84| v84_9(void) = AliasedUse : ~m?
3619
+ # 84| v84_10(void) = ExitFunction :
3613
3620
3614
3621
ir.cpp:
3615
3622
# 1| void Constants()
You can’t perform that action at this time.
0 commit comments