xref: /minix3/external/bsd/llvm/dist/clang/test/Modules/diag-pragma.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: rm -rf %t
2*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diag_pragma %S/Inputs/module.map
3*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -fmodules -x objective-c -verify -fmodules-cache-path=%t %s
4*f4a2713aSLionel Sambuc // FIXME: When we have a syntax for modules in C, use that.
5*f4a2713aSLionel Sambuc 
6*f4a2713aSLionel Sambuc @import diag_pragma;
7*f4a2713aSLionel Sambuc 
8*f4a2713aSLionel Sambuc int foo(int x) {
9*f4a2713aSLionel Sambuc   if (x = DIAG_PRAGMA_MACRO) // expected-warning {{using the result of an assignment as a condition without parentheses}} \
10*f4a2713aSLionel Sambuc                              // expected-note {{place parentheses}} expected-note {{use '=='}}
11*f4a2713aSLionel Sambuc     return 0;
12*f4a2713aSLionel Sambuc   return 1;
13*f4a2713aSLionel Sambuc }
14