xref: /aosp_15_r20/external/clang/test/Analysis/qt_malloc.cpp (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li // RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.deadcode.UnreachableCode,alpha.core.CastSize,unix.Malloc,cplusplus -analyzer-store=region -verify %s
2*67e74705SXin Li // expected-no-diagnostics
3*67e74705SXin Li #include "Inputs/qt-simulator.h"
4*67e74705SXin Li 
send(QObject * obj)5*67e74705SXin Li void send(QObject *obj)
6*67e74705SXin Li {
7*67e74705SXin Li   QEvent *e1 = new QEvent(QEvent::None);
8*67e74705SXin Li   static_cast<QApplication *>(QCoreApplication::instance())->postEvent(obj, e1);
9*67e74705SXin Li   QEvent *e2 = new QEvent(QEvent::None);
10*67e74705SXin Li   QCoreApplication::instance()->postEvent(obj, e2);
11*67e74705SXin Li   QEvent *e3 = new QEvent(QEvent::None);
12*67e74705SXin Li   QCoreApplication::postEvent(obj, e3);
13*67e74705SXin Li   QEvent *e4 = new QEvent(QEvent::None);
14*67e74705SXin Li   QApplication::postEvent(obj, e4);
15*67e74705SXin Li }
16