Mercurial > hg > CbC > CbC_llvm
view clang/test/Preprocessor/pragma_assume_nonnull.c @ 236:c4bab56944e8 llvm-original
LLVM 16
author | kono |
---|---|
date | Wed, 09 Nov 2022 17:45:10 +0900 |
parents | 1d019706d866 |
children |
line wrap: on
line source
// RUN: %clang_cc1 -fsyntax-only -verify %s // RUN: %clang_cc1 -E %s | FileCheck %s // CHECK: #pragma clang assume_nonnull begin #pragma clang assume_nonnull begin int bar(int * ip) { return *ip; } // CHECK: #pragma clang assume_nonnull end #pragma clang assume_nonnull end int foo(int * _Nonnull ip) { return *ip; } int main(void) { return bar(0) + foo(0); // expected-warning 2 {{null passed to a callee that requires a non-null argument}} }