1*900f8175SDuncan P. N. Exon Smith // Check that implicit modules builds give correct diagnostics, even when
2*900f8175SDuncan P. N. Exon Smith // reusing a module built with strong -Werror flags.
3*900f8175SDuncan P. N. Exon Smith //
4*900f8175SDuncan P. N. Exon Smith // Clear the caches.
5*900f8175SDuncan P. N. Exon Smith // RUN: rm -rf %t.cache %t-pragma.cache
6*900f8175SDuncan P. N. Exon Smith //
7*900f8175SDuncan P. N. Exon Smith // Build with -Werror, then with -W, and then with neither.
8*900f8175SDuncan P. N. Exon Smith // RUN: not %clang_cc1 -triple x86_64-apple-darwin16 -fsyntax-only -fmodules \
9*900f8175SDuncan P. N. Exon Smith // RUN:   -Werror=shorten-64-to-32 \
10*900f8175SDuncan P. N. Exon Smith // RUN:   -I%S/Inputs/implicit-built-Werror-using-W -fimplicit-module-maps \
11*900f8175SDuncan P. N. Exon Smith // RUN:   -fmodules-cache-path=%t.cache -x c++ %s 2>&1 \
12*900f8175SDuncan P. N. Exon Smith // RUN: | FileCheck %s -check-prefix=CHECK-ERROR
13*900f8175SDuncan P. N. Exon Smith // RUN: %clang_cc1 -triple x86_64-apple-darwin16 -fsyntax-only -fmodules \
14*900f8175SDuncan P. N. Exon Smith // RUN:   -Wshorten-64-to-32 \
15*900f8175SDuncan P. N. Exon Smith // RUN:   -I%S/Inputs/implicit-built-Werror-using-W -fimplicit-module-maps \
16*900f8175SDuncan P. N. Exon Smith // RUN:   -fdisable-module-hash \
17*900f8175SDuncan P. N. Exon Smith // RUN:   -fmodules-cache-path=%t.cache -x c++ %s 2>&1 \
18*900f8175SDuncan P. N. Exon Smith // RUN: | FileCheck %s -check-prefix=CHECK-WARN
19*900f8175SDuncan P. N. Exon Smith // RUN: %clang_cc1 -triple x86_64-apple-darwin16 -fsyntax-only -fmodules \
20*900f8175SDuncan P. N. Exon Smith // RUN:   -I%S/Inputs/implicit-built-Werror-using-W -fimplicit-module-maps \
21*900f8175SDuncan P. N. Exon Smith // RUN:   -fmodules-cache-path=%t.cache -x c++ %s 2>&1 \
22*900f8175SDuncan P. N. Exon Smith // RUN: | FileCheck %s -allow-empty
23*900f8175SDuncan P. N. Exon Smith //
24*900f8175SDuncan P. N. Exon Smith // In the presence of a warning pragma, build with -Werror and then without.
25*900f8175SDuncan P. N. Exon Smith // RUN: not %clang_cc1 -triple x86_64-apple-darwin16 -fsyntax-only -fmodules \
26*900f8175SDuncan P. N. Exon Smith // RUN:   -DUSE_PRAGMA -Werror=shorten-64-to-32 \
27*900f8175SDuncan P. N. Exon Smith // RUN:   -I%S/Inputs/implicit-built-Werror-using-W -fimplicit-module-maps \
28*900f8175SDuncan P. N. Exon Smith // RUN:   -fmodules-cache-path=%t-pragma.cache -x c++ %s 2>&1 \
29*900f8175SDuncan P. N. Exon Smith // RUN: | FileCheck %s -check-prefix=CHECK-ERROR
30*900f8175SDuncan P. N. Exon Smith // RUN: %clang_cc1 -triple x86_64-apple-darwin16 -fsyntax-only -fmodules \
31*900f8175SDuncan P. N. Exon Smith // RUN:   -DUSE_PRAGMA \
32*900f8175SDuncan P. N. Exon Smith // RUN:   -I%S/Inputs/implicit-built-Werror-using-W -fimplicit-module-maps \
33*900f8175SDuncan P. N. Exon Smith // RUN:   -fmodules-cache-path=%t-pragma.cache -x c++ %s 2>&1 \
34*900f8175SDuncan P. N. Exon Smith // RUN: | FileCheck %s -check-prefix=CHECK-WARN
35*900f8175SDuncan P. N. Exon Smith #include <convert.h>
36*900f8175SDuncan P. N. Exon Smith 
foo()37*900f8175SDuncan P. N. Exon Smith long long foo() { return convert<long long>(0); }
38*900f8175SDuncan P. N. Exon Smith 
39*900f8175SDuncan P. N. Exon Smith // CHECK-ERROR: error: implicit conversion
40*900f8175SDuncan P. N. Exon Smith // CHECK-WARN: warning: implicit conversion
41*900f8175SDuncan P. N. Exon Smith // CHECK-NOT: error: implicit conversion
42*900f8175SDuncan P. N. Exon Smith // CHECK-NOT: warning: implicit conversion
43