Skip to content

Commit b161ff1

Browse files
committed
C#: Additional CFG tests
1 parent 797fc07 commit b161ff1

14 files changed

+1254
-162
lines changed

csharp/ql/test/library-tests/controlflow/graph/BasicBlock.expected

Lines changed: 56 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,14 @@
7070
| ConditionalAccess.cs:19:12:19:13 | enter M6 | ConditionalAccess.cs:19:40:19:41 | access to parameter s1 | 2 |
7171
| ConditionalAccess.cs:19:12:19:13 | exit M6 | ConditionalAccess.cs:19:12:19:13 | exit M6 | 1 |
7272
| ConditionalAccess.cs:19:58:19:59 | access to parameter s2 | ConditionalAccess.cs:19:43:19:60 | call to method CommaJoinWith | 2 |
73-
| ConditionalAccess.cs:24:26:24:38 | enter CommaJoinWith | ConditionalAccess.cs:24:26:24:38 | exit CommaJoinWith | 7 |
73+
| ConditionalAccess.cs:21:10:21:11 | enter M7 | ConditionalAccess.cs:23:18:23:29 | (...) ... | 6 |
74+
| ConditionalAccess.cs:23:13:23:38 | Nullable<Int32> j = ... | ConditionalAccess.cs:24:18:24:24 | (...) ... | 5 |
75+
| ConditionalAccess.cs:23:32:23:38 | access to property Length | ConditionalAccess.cs:23:32:23:38 | access to property Length | 1 |
76+
| ConditionalAccess.cs:24:13:24:37 | String s = ... | ConditionalAccess.cs:25:13:25:14 | "" | 4 |
77+
| ConditionalAccess.cs:24:27:24:37 | call to method ToString | ConditionalAccess.cs:24:27:24:37 | call to method ToString | 1 |
78+
| ConditionalAccess.cs:25:9:25:32 | ... = ... | ConditionalAccess.cs:21:10:21:11 | exit M7 | 2 |
79+
| ConditionalAccess.cs:25:31:25:31 | access to local variable s | ConditionalAccess.cs:25:16:25:32 | call to method CommaJoinWith | 2 |
80+
| ConditionalAccess.cs:31:26:31:38 | enter CommaJoinWith | ConditionalAccess.cs:31:26:31:38 | exit CommaJoinWith | 7 |
7481
| ExitMethods.cs:6:10:6:11 | enter M1 | ExitMethods.cs:6:10:6:11 | exit M1 | 7 |
7582
| ExitMethods.cs:12:10:12:11 | enter M2 | ExitMethods.cs:12:10:12:11 | exit M2 | 7 |
7683
| ExitMethods.cs:18:10:18:11 | enter M3 | ExitMethods.cs:18:10:18:11 | exit M3 | 6 |
@@ -102,14 +109,20 @@
102109
| Extensions.cs:10:24:10:29 | enter ToBool | Extensions.cs:10:24:10:29 | exit ToBool | 7 |
103110
| Extensions.cs:15:23:15:33 | enter CallToInt32 | Extensions.cs:15:23:15:33 | exit CallToInt32 | 4 |
104111
| Extensions.cs:20:17:20:20 | enter Main | Extensions.cs:20:17:20:20 | exit Main | 19 |
105-
| Foreach.cs:3:10:3:11 | enter M1 | Foreach.cs:5:29:5:32 | access to parameter args | 3 |
106-
| Foreach.cs:3:10:3:11 | exit M1 | Foreach.cs:3:10:3:11 | exit M1 | 1 |
107-
| Foreach.cs:5:9:6:13 | foreach (... ... in ...) ... | Foreach.cs:5:9:6:13 | foreach (... ... in ...) ... | 1 |
108-
| Foreach.cs:5:22:5:24 | String arg | Foreach.cs:6:13:6:13 | ; | 2 |
109-
| Foreach.cs:9:10:9:11 | enter M2 | Foreach.cs:11:27:11:30 | access to parameter args | 3 |
110-
| Foreach.cs:9:10:9:11 | exit M2 | Foreach.cs:9:10:9:11 | exit M2 | 1 |
111-
| Foreach.cs:11:9:12:13 | foreach (... ... in ...) ... | Foreach.cs:11:9:12:13 | foreach (... ... in ...) ... | 1 |
112-
| Foreach.cs:12:13:12:13 | ; | Foreach.cs:12:13:12:13 | ; | 1 |
112+
| Foreach.cs:6:10:6:11 | enter M1 | Foreach.cs:8:29:8:32 | access to parameter args | 3 |
113+
| Foreach.cs:6:10:6:11 | exit M1 | Foreach.cs:6:10:6:11 | exit M1 | 1 |
114+
| Foreach.cs:8:9:9:13 | foreach (... ... in ...) ... | Foreach.cs:8:9:9:13 | foreach (... ... in ...) ... | 1 |
115+
| Foreach.cs:8:22:8:24 | String arg | Foreach.cs:9:13:9:13 | ; | 2 |
116+
| Foreach.cs:12:10:12:11 | enter M2 | Foreach.cs:14:27:14:30 | access to parameter args | 3 |
117+
| Foreach.cs:12:10:12:11 | exit M2 | Foreach.cs:12:10:12:11 | exit M2 | 1 |
118+
| Foreach.cs:14:9:15:13 | foreach (... ... in ...) ... | Foreach.cs:14:9:15:13 | foreach (... ... in ...) ... | 1 |
119+
| Foreach.cs:15:13:15:13 | ; | Foreach.cs:15:13:15:13 | ; | 1 |
120+
| Foreach.cs:18:10:18:11 | enter M3 | Foreach.cs:20:27:20:27 | access to parameter e | 4 |
121+
| Foreach.cs:18:10:18:11 | exit M3 | Foreach.cs:18:10:18:11 | exit M3 | 1 |
122+
| Foreach.cs:20:9:21:11 | foreach (... ... in ...) ... | Foreach.cs:20:9:21:11 | foreach (... ... in ...) ... | 1 |
123+
| Foreach.cs:20:22:20:22 | String x | Foreach.cs:21:11:21:11 | ; | 2 |
124+
| Foreach.cs:20:29:20:38 | call to method ToArray | Foreach.cs:20:29:20:38 | call to method ToArray | 1 |
125+
| Foreach.cs:20:43:20:68 | call to method Empty | Foreach.cs:20:43:20:68 | call to method Empty | 1 |
113126
| Initializers.cs:6:5:6:16 | enter Initializers | Initializers.cs:6:5:6:16 | exit Initializers | 3 |
114127
| Initializers.cs:8:10:8:10 | enter M | Initializers.cs:8:10:8:10 | exit M | 23 |
115128
| NullCoalescing.cs:3:9:3:10 | enter M1 | NullCoalescing.cs:3:23:3:23 | access to parameter i | 3 |
@@ -136,6 +149,13 @@
136149
| NullCoalescing.cs:11:57:11:58 | access to parameter b3 | NullCoalescing.cs:11:57:11:58 | access to parameter b3 | 1 |
137150
| NullCoalescing.cs:11:64:11:64 | 0 | NullCoalescing.cs:11:64:11:64 | 0 | 1 |
138151
| NullCoalescing.cs:11:68:11:68 | 1 | NullCoalescing.cs:11:68:11:68 | 1 | 1 |
152+
| NullCoalescing.cs:13:10:13:11 | enter M6 | NullCoalescing.cs:15:17:15:26 | (...) ... | 7 |
153+
| NullCoalescing.cs:15:13:15:31 | Int32 j = ... | NullCoalescing.cs:16:17:16:18 | "" | 5 |
154+
| NullCoalescing.cs:15:31:15:31 | 0 | NullCoalescing.cs:15:31:15:31 | 0 | 1 |
155+
| NullCoalescing.cs:16:13:16:25 | String s = ... | NullCoalescing.cs:17:13:17:19 | (...) ... | 6 |
156+
| NullCoalescing.cs:16:23:16:25 | "a" | NullCoalescing.cs:16:23:16:25 | "a" | 1 |
157+
| NullCoalescing.cs:17:9:17:24 | ... = ... | NullCoalescing.cs:13:10:13:11 | exit M6 | 2 |
158+
| NullCoalescing.cs:17:24:17:24 | 1 | NullCoalescing.cs:17:24:17:24 | 1 | 1 |
139159
| Patterns.cs:5:10:5:13 | enter Test | Patterns.cs:8:13:8:23 | ... is ... | 10 |
140160
| Patterns.cs:9:9:11:9 | {...} | Patterns.cs:10:13:10:42 | call to method WriteLine | 6 |
141161
| Patterns.cs:12:14:18:9 | if (...) ... | Patterns.cs:12:18:12:31 | ... is ... | 4 |
@@ -184,7 +204,33 @@
184204
| Switch.cs:50:13:50:39 | case Boolean: | Switch.cs:50:18:50:21 | access to type Boolean | 2 |
185205
| Switch.cs:50:30:50:30 | access to parameter o | Switch.cs:50:30:50:38 | ... != ... | 3 |
186206
| Switch.cs:51:17:51:22 | break; | Switch.cs:51:17:51:22 | break; | 1 |
187-
| Switch.cs:55:17:55:21 | enter Throw | Switch.cs:55:17:55:21 | exit Throw | 4 |
207+
| Switch.cs:55:10:55:11 | enter M5 | Switch.cs:59:18:59:18 | 2 | 8 |
208+
| Switch.cs:55:10:55:11 | exit M5 | Switch.cs:55:10:55:11 | exit M5 | 1 |
209+
| Switch.cs:60:15:60:20 | break; | Switch.cs:60:15:60:20 | break; | 1 |
210+
| Switch.cs:61:13:61:20 | case ...: | Switch.cs:61:18:61:18 | 3 | 2 |
211+
| Switch.cs:62:15:62:20 | break; | Switch.cs:62:15:62:20 | break; | 1 |
212+
| Switch.cs:66:10:66:11 | enter M6 | Switch.cs:70:18:70:20 | access to type Int32 | 7 |
213+
| Switch.cs:66:10:66:11 | exit M6 | Switch.cs:66:10:66:11 | exit M6 | 1 |
214+
| Switch.cs:71:15:71:20 | break; | Switch.cs:71:15:71:20 | break; | 1 |
215+
| Switch.cs:72:13:72:21 | case ...: | Switch.cs:72:18:72:19 | "" | 2 |
216+
| Switch.cs:73:15:73:20 | break; | Switch.cs:73:15:73:20 | break; | 1 |
217+
| Switch.cs:77:10:77:11 | enter M7 | Switch.cs:81:18:81:18 | 1 | 6 |
218+
| Switch.cs:77:10:77:11 | exit M7 | Switch.cs:77:10:77:11 | exit M7 | 1 |
219+
| Switch.cs:82:22:82:25 | true | Switch.cs:82:15:82:26 | return ...; | 2 |
220+
| Switch.cs:83:13:83:20 | case ...: | Switch.cs:84:19:84:23 | ... > ... | 6 |
221+
| Switch.cs:85:17:85:22 | break; | Switch.cs:88:9:88:21 | return ...; | 3 |
222+
| Switch.cs:86:22:86:25 | true | Switch.cs:86:15:86:26 | return ...; | 2 |
223+
| Switch.cs:91:10:91:11 | enter M8 | Switch.cs:95:18:95:20 | access to type Int32 | 6 |
224+
| Switch.cs:91:10:91:11 | exit M8 | Switch.cs:91:10:91:11 | exit M8 | 1 |
225+
| Switch.cs:96:22:96:25 | true | Switch.cs:96:15:96:26 | return ...; | 2 |
226+
| Switch.cs:98:16:98:20 | false | Switch.cs:98:9:98:21 | return ...; | 2 |
227+
| Switch.cs:101:9:101:10 | enter M9 | Switch.cs:105:18:105:18 | 0 | 7 |
228+
| Switch.cs:101:9:101:10 | exit M9 | Switch.cs:101:9:101:10 | exit M9 | 1 |
229+
| Switch.cs:105:29:105:29 | 0 | Switch.cs:105:22:105:30 | return ...; | 2 |
230+
| Switch.cs:106:13:106:20 | case ...: | Switch.cs:106:18:106:18 | 1 | 2 |
231+
| Switch.cs:106:29:106:29 | 1 | Switch.cs:106:22:106:30 | return ...; | 2 |
232+
| Switch.cs:108:17:108:17 | 1 | Switch.cs:108:9:108:18 | return ...; | 3 |
233+
| Switch.cs:111:17:111:21 | enter Throw | Switch.cs:111:17:111:21 | exit Throw | 4 |
188234
| TypeAccesses.cs:3:10:3:10 | enter M | TypeAccesses.cs:7:13:7:22 | ... is ... | 16 |
189235
| TypeAccesses.cs:7:25:7:25 | ; | TypeAccesses.cs:7:25:7:25 | ; | 1 |
190236
| TypeAccesses.cs:8:9:8:28 | ... ...; | TypeAccesses.cs:3:10:3:10 | exit M | 5 |

0 commit comments

Comments
 (0)