| 1 |
/* iig(DriverKit-60) generated from SomethingSomething.iig */ |
| 2 |
|
| 3 |
// The comment above is the whole point of the test. |
| 4 |
// That's how the suppression works. |
| 5 |
// It needs to be on the top. |
| 6 |
// Run-lines can wait. |
| 7 |
|
| 8 |
// RUN: %clang_analyze_cc1 -std=c++17 -w -triple x86_64-apple-driverkit19.0 \ |
| 9 |
// RUN: -analyzer-checker=deadcode -verify %s |
| 10 |
|
| 11 |
// expected-no-diagnostics |
| 12 |
|
| 13 |
#include "os_object_base.h" |
| 14 |
|
| 15 |
class OSSomething { |
| 16 |
kern_return_t Invoke(const IORPC); |
| 17 |
void foo(OSDispatchMethod supermethod) { |
| 18 |
kern_return_t ret; |
| 19 |
IORPC rpc; |
| 20 |
// Test the DriverKit specific suppression in the dead stores checker. |
| 21 |
if (supermethod) ret = supermethod((OSObject *)this, rpc); // no-warning |
| 22 |
else ret = ((OSObject *)this)->Invoke(rpc); // no-warning |
| 23 |
} |
| 24 |
}; |