(tc *oneGuardStruct)
| 25 | } |
| 26 | |
| 27 | func testConsistentBranching(tc *oneGuardStruct) { |
| 28 | x := rand.Intn(10) |
| 29 | if x%2 == 1 { |
| 30 | tc.mu.Lock() |
| 31 | } else { |
| 32 | tc.mu.Lock() |
| 33 | } |
| 34 | tc.guardedField = 1 |
| 35 | if x%2 == 1 { |
| 36 | tc.mu.Unlock() |
| 37 | } else { |
| 38 | tc.mu.Unlock() |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | func testInconsistentBranching(tc *oneGuardStruct) { // +checklocksfail=incompatible return states|incompatible return states |
| 43 | // We traverse the control flow graph in all consistent ways. We cannot |