[NFC][AArch64] Explicitly define undefined bits for instructions (#122129)
[llvm-project.git] / clang / test / Analysis / Checkers / WebKit / call-args-checked.cpp
blob49b6bfcd7cadfdcd4fcf2db305e046914ed167f2
1 // RUN: %clang_analyze_cc1 -analyzer-checker=alpha.webkit.UncountedCallArgsChecker -verify %s
3 #include "mock-types.h"
5 RefCountableAndCheckable* makeObj();
6 CheckedRef<RefCountableAndCheckable> makeObjChecked();
7 void someFunction(RefCountableAndCheckable*);
9 namespace call_args_unchecked_uncounted {
11 static void foo() {
12 someFunction(makeObj());
13 // expected-warning@-1{{Call argument is uncounted and unsafe [alpha.webkit.UncountedCallArgsChecker]}}
16 } // namespace call_args_checked
18 namespace call_args_checked {
20 static void foo() {
21 CheckedPtr<RefCountableAndCheckable> ptr = makeObj();
22 someFunction(ptr.get());
25 static void bar() {
26 someFunction(CheckedPtr { makeObj() }.get());
29 static void baz() {
30 someFunction(makeObjChecked().ptr());
33 } // namespace call_args_checked
35 namespace call_args_default {
37 void someFunction(RefCountableAndCheckable* = makeObj());
38 // expected-warning@-1{{Call argument is uncounted and unsafe [alpha.webkit.UncountedCallArgsChecker]}}
39 void otherFunction(RefCountableAndCheckable* = makeObjChecked().ptr());
41 void foo() {
42 someFunction();
43 otherFunction();