xref: /aosp_15_r20/external/clang/test/Misc/include-stack-for-note-flag.cpp (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li // RUN: not %clang_cc1 -fsyntax-only -fdiagnostics-show-note-include-stack %s 2>&1 | FileCheck %s -check-prefix=STACK
2*67e74705SXin Li // RUN: not %clang_cc1 -fsyntax-only -fno-diagnostics-show-note-include-stack %s 2>&1 | FileCheck %s -check-prefix=STACKLESS
3*67e74705SXin Li // RUN: not %clang_cc1 -fsyntax-only -fno-diagnostics-show-note-include-stack -fdiagnostics-show-note-include-stack %s 2>&1 | FileCheck %s -check-prefix=STACK
4*67e74705SXin Li // RUN: not %clang_cc1 -fsyntax-only -fdiagnostics-show-note-include-stack -fno-diagnostics-show-note-include-stack %s 2>&1 | FileCheck %s -check-prefix=STACKLESS
5*67e74705SXin Li // RUN: not %clang_cc1 -fsyntax-only %s 2>&1 | FileCheck %s -check-prefix=STACKLESS
6*67e74705SXin Li 
7*67e74705SXin Li #include "Inputs/include.h"
test()8*67e74705SXin Li int test() {
9*67e74705SXin Li   return foo(1, 1);
10*67e74705SXin Li }
11*67e74705SXin Li 
macro(int x,int y)12*67e74705SXin Li bool macro(int x, int y) {
13*67e74705SXin Li   return EQUALS(&x, y);
14*67e74705SXin Li }
15*67e74705SXin Li 
16*67e74705SXin Li // STACK: error: no matching function for call to 'foo'
17*67e74705SXin Li // STACK:  In file included from
18*67e74705SXin Li // STACK: note: candidate function not viable
19*67e74705SXin Li // STACK: error: comparison between pointer and integer
20*67e74705SXin Li // STACK:  In file included from
21*67e74705SXin Li // STACK: note: expanded from macro
22*67e74705SXin Li 
23*67e74705SXin Li // STACKLESS: error: no matching function for call to 'foo'
24*67e74705SXin Li // STACKLESS-NOT:  In file included from
25*67e74705SXin Li // STACKLESS: note: candidate function not viable
26*67e74705SXin Li // STACKLESS: error: comparison between pointer and integer
27*67e74705SXin Li // STACKLESS-NOT:  In file included from
28*67e74705SXin Li // STACKLESS: note: expanded from macro
29