annotate clang/test/Modules/macro-redefinition.cpp @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -fmodules -x c++-module-map %s -fmodule-name=__usr_include -verify
anatofuz
parents:
diff changeset
2 // RUN: %clang_cc1 -fmodules -x c++-module-map %s -fmodule-name=__usr_include -verify -DIMPORT
anatofuz
parents:
diff changeset
3
anatofuz
parents:
diff changeset
4 module __usr_include {
anatofuz
parents:
diff changeset
5 module stddef {}
anatofuz
parents:
diff changeset
6 module stdlib {}
anatofuz
parents:
diff changeset
7 }
anatofuz
parents:
diff changeset
8
anatofuz
parents:
diff changeset
9 #pragma clang module contents
anatofuz
parents:
diff changeset
10
anatofuz
parents:
diff changeset
11 // expected-no-diagnostics
anatofuz
parents:
diff changeset
12
anatofuz
parents:
diff changeset
13 #pragma clang module begin __usr_include.stddef
anatofuz
parents:
diff changeset
14 #define NULL 0
anatofuz
parents:
diff changeset
15 #pragma clang module end
anatofuz
parents:
diff changeset
16
anatofuz
parents:
diff changeset
17 #pragma clang module begin __usr_include.stdlib
anatofuz
parents:
diff changeset
18 #ifdef IMPORT
anatofuz
parents:
diff changeset
19 #pragma clang module import __usr_include.stddef
anatofuz
parents:
diff changeset
20 #else
anatofuz
parents:
diff changeset
21 #pragma clang module begin __usr_include.stddef
anatofuz
parents:
diff changeset
22 #define NULL 0
anatofuz
parents:
diff changeset
23 #pragma clang module end
anatofuz
parents:
diff changeset
24 #endif
anatofuz
parents:
diff changeset
25
anatofuz
parents:
diff changeset
26 void *f() { return NULL; } // ok, NULL is visible here
anatofuz
parents:
diff changeset
27 #pragma clang module end