[lld][WebAssembly] Reinstate mistakenly disabled test. NFC
[llvm-project.git] / clang / test / Modules / context-hash.c
blob8bb7422f6a54f09fd1e1a971959534941d8679d3
1 // This test verifies that only strict hashing includes search paths and
2 // diagnostics in the module context hash.
4 // RUN: rm -rf %t
5 // RUN: %clang_cc1 -fsyntax-only -internal-isystem \
6 // RUN: %S/Inputs/System/usr/include -fmodules -fimplicit-module-maps \
7 // RUN: -fmodules-cache-path=%t %s -Rmodule-build 2> %t1
8 // RUN: rm -rf %t
9 // RUN: %clang_cc1 -fsyntax-only -internal-isystem \
10 // RUN: %S/Inputs/System/usr/include -internal-isystem %S -fmodules \
11 // RUN: -fimplicit-module-maps -fmodules-cache-path=%t %s -Rmodule-build 2> \
12 // RUN: %t2
13 // RUN: rm -rf %t
14 // RUN: %clang_cc1 -fsyntax-only -internal-isystem \
15 // RUN: %S/Inputs/System/usr/include -internal-isystem %S -fmodules \
16 // RUN: -fimplicit-module-maps -fmodules-cache-path=%t %s \
17 // RUN: -fmodules-strict-context-hash -Rmodule-build 2> %t3
18 // RUN: rm -rf %t
19 // RUN: %clang_cc1 -fsyntax-only -Weverything -internal-isystem \
20 // RUN: %S/Inputs/System/usr/include -fmodules -fmodules-strict-context-hash \
21 // RUN: -fimplicit-module-maps -fmodules-cache-path=%t %s -Rmodule-build 2> \
22 // RUN: %t4
23 // RUN: echo %t > %t.path
24 // RUN: cat %t.path %t1 %t2 %t3 %t4 | FileCheck %s
26 // This tests things verified by ASTReader::checkLanguageOptions that are not
27 // part of LangOpts.def.
29 // RUN: rm -rf %t
30 // RUN: %clang_cc1 -fsyntax-only -internal-isystem \
31 // RUN: %S/Inputs/System/usr/include -fmodules -fimplicit-module-maps \
32 // RUN: -fmodules-cache-path=%t -x objective-c %s -Rmodule-build 2> %t1
33 // RUN: rm -rf %t
34 // RUN: %clang_cc1 -fsyntax-only -internal-isystem \
35 // RUN: %S/Inputs/System/usr/include -fmodules -fimplicit-module-maps \
36 // RUN: -fobjc-runtime=macosx-1.0.0.0 \
37 // RUN: -fmodules-cache-path=%t -x objective-c %s -Rmodule-build 2> %t2
38 // RUN: rm -rf %t
39 // RUN: %clang_cc1 -fsyntax-only -internal-isystem \
40 // RUN: %S/Inputs/System/usr/include -fmodules -fimplicit-module-maps \
41 // RUN: -fcomment-block-commands=lp,bj \
42 // RUN: -fmodules-cache-path=%t -x objective-c %s -Rmodule-build 2> %t3
43 // RUN: echo %t > %t.path
44 // RUN: cat %t.path %t1 %t2 %t3 | FileCheck --check-prefix=LANGOPTS %s
46 #include <stdio.h>
48 // CHECK: [[PREFIX:(.*[/\\])+[a-zA-Z0-9.-]+]]
49 // CHECK: building module 'cstd' as '[[PREFIX]]{{[/\\]}}[[CONTEXT_HASH:[A-Z0-9]+]]{{[/\\]}}cstd-[[AST_HASH:[A-Z0-9]+]].pcm'
50 // CHECK: building module 'cstd' as '{{.*[/\\]}}[[CONTEXT_HASH]]{{[/\\]}}cstd-[[AST_HASH]].pcm'
51 // CHECK-NOT: building module 'cstd' as '{{.*[/\\]}}[[CONTEXT_HASH]]{{[/\\]}}
52 // CHECK: cstd-[[AST_HASH]].pcm'
53 // CHECK-NOT: building module 'cstd' as '{{.*[/\\]}}[[CONTEXT_HASH]]{{[/\\]}}
54 // CHECK: cstd-[[AST_HASH]].pcm'
56 // LANGOPTS: [[PREFIX:(.*[/\\])+[a-zA-Z0-9.-]+]]
57 // LANGOPTS: building module 'cstd' as '[[PREFIX]]{{[/\\]}}[[CONTEXT_HASH:[A-Z0-9]+]]{{[/\\]}}cstd-[[AST_HASH:[A-Z0-9]+]].pcm'
58 // LANGOPTS-NOT: building module 'cstd' as '{{.*[/\\]}}[[CONTEXT_HASH]]{{[/\\]}}
59 // LANGOPTS: cstd-[[AST_HASH]].pcm'
60 // LANGOPTS-NOT: building module 'cstd' as '{{.*[/\\]}}[[CONTEXT_HASH]]{{[/\\]}}
61 // LANGOPTS: cstd-[[AST_HASH]].pcm'