25 lines · cpp
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 %s10 11// expected-no-diagnostics12 13#include "os_object_base.h"14 15class 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-warning22 else ret = ((OSObject *)this)->Invoke(rpc); // no-warning23 }24};25