annotate clang/test/Modules/extensions.c @ 266:00f31e85ec16 default tip

Added tag current for changeset 31d058e83c98
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 14 Oct 2023 10:13:55 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // Test creation of modules that include extension blocks.
anatofuz
parents:
diff changeset
2 // RUN: rm -rf %t
anatofuz
parents:
diff changeset
3 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fdisable-module-hash -ftest-module-file-extension=clang.testA:1:5:0:user_info_for_A -ftest-module-file-extension=clang.testB:2:3:0:user_info_for_B -fmodules-cache-path=%t -I %S/Inputs %s
anatofuz
parents:
diff changeset
4
anatofuz
parents:
diff changeset
5 // Make sure the extension blocks are actually there.
anatofuz
parents:
diff changeset
6 // RUN: llvm-bcanalyzer %t/ExtensionTestA.pcm | FileCheck -check-prefix=CHECK-BCANALYZER %s
anatofuz
parents:
diff changeset
7 // RUN: %clang_cc1 -module-file-info %t/ExtensionTestA.pcm | FileCheck -check-prefix=CHECK-INFO %s
anatofuz
parents:
diff changeset
8
anatofuz
parents:
diff changeset
9 // Make sure that the readers are able to check the metadata.
anatofuz
parents:
diff changeset
10 // RUN: rm -rf %t
anatofuz
parents:
diff changeset
11 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -ftest-module-file-extension=clang.testA:1:5:0:user_info_for_A -ftest-module-file-extension=clang.testB:2:3:0:user_info_for_B -fmodules-cache-path=%t -I %S/Inputs %s
anatofuz
parents:
diff changeset
12 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -ftest-module-file-extension=clang.testA:1:3:0:user_info_for_A -ftest-module-file-extension=clang.testB:3:2:0:user_info_for_B -fmodules-cache-path=%t -I %S/Inputs %s -verify
anatofuz
parents:
diff changeset
13
anatofuz
parents:
diff changeset
14 // Make sure that extension blocks can be part of the module hash.
anatofuz
parents:
diff changeset
15 // We test this in an obscure way, by making sure we don't get conflicts when
anatofuz
parents:
diff changeset
16 // using different "versions" of the extensions. Above, the "-verify" test
anatofuz
parents:
diff changeset
17 // checks that such conflicts produce errors.
anatofuz
parents:
diff changeset
18 // RUN: rm -rf %t
anatofuz
parents:
diff changeset
19 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -ftest-module-file-extension=clang.testA:1:5:1:user_info_for_A -ftest-module-file-extension=clang.testB:2:3:1:user_info_for_B -fmodules-cache-path=%t -I %S/Inputs %s
anatofuz
parents:
diff changeset
20 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -ftest-module-file-extension=clang.testA:1:3:1:user_info_for_A -ftest-module-file-extension=clang.testB:3:2:1:user_info_for_B -fmodules-cache-path=%t -I %S/Inputs %s
anatofuz
parents:
diff changeset
21 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -ftest-module-file-extension=clang.testA:2:5:0:user_info_for_A -ftest-module-file-extension=clang.testB:7:3:0:user_info_for_B -fmodules-cache-path=%t -I %S/Inputs %s
anatofuz
parents:
diff changeset
22
anatofuz
parents:
diff changeset
23 // Make sure we can read the message back.
anatofuz
parents:
diff changeset
24 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fdisable-module-hash -ftest-module-file-extension=clang.testA:1:5:0:user_info_for_A -ftest-module-file-extension=clang.testB:2:3:0:user_info_for_B -fmodules-cache-path=%t -I %S/Inputs %s > %t.log 2>&1
anatofuz
parents:
diff changeset
25 // RUN: FileCheck -check-prefix=CHECK-MESSAGE %s < %t.log
anatofuz
parents:
diff changeset
26
anatofuz
parents:
diff changeset
27 // Make sure we diagnose duplicate module file extensions.
anatofuz
parents:
diff changeset
28 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fdisable-module-hash -ftest-module-file-extension=clang.testA:1:5:0:user_info_for_A -ftest-module-file-extension=clang.testA:1:5:0:user_info_for_A -fmodules-cache-path=%t -I %S/Inputs %s > %t.log 2>&1
anatofuz
parents:
diff changeset
29 // RUN: FileCheck -check-prefix=CHECK-DUPLICATE %s < %t.log
anatofuz
parents:
diff changeset
30
anatofuz
parents:
diff changeset
31 #include "ExtensionTestA.h"
anatofuz
parents:
diff changeset
32 // expected-error@-1{{test module file extension 'clang.testA' has different version (1.5) than expected (1.3)}}
anatofuz
parents:
diff changeset
33 // expected-error@-2{{test module file extension 'clang.testB' has different version (2.3) than expected (3.2)}}
anatofuz
parents:
diff changeset
34
anatofuz
parents:
diff changeset
35 // CHECK-BCANALYZER: {{Block ID.*EXTENSION_BLOCK}}
anatofuz
parents:
diff changeset
36 // CHECK-BCANALYZER: {{100.00.*EXTENSION_METADATA}}
anatofuz
parents:
diff changeset
37
anatofuz
parents:
diff changeset
38 // CHECK-INFO: Module file extension 'clang.testA' 1.5: user_info_for_A
anatofuz
parents:
diff changeset
39 // CHECK-INFO: Module file extension 'clang.testB' 2.3: user_info_for_B
anatofuz
parents:
diff changeset
40
anatofuz
parents:
diff changeset
41 // CHECK-MESSAGE: Read extension block message: Hello from clang.testA v1.5
anatofuz
parents:
diff changeset
42 // CHECK-MESSAGE: Read extension block message: Hello from clang.testB v2.3
anatofuz
parents:
diff changeset
43
anatofuz
parents:
diff changeset
44 // CHECK-DUPLICATE: warning: duplicate module file extension block name 'clang.testA'