annotate clang/test/Index/pch-from-libclang.c @ 173:0572611fdcc8 llvm10 llvm12

reorgnization done
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 11:55:54 +0900
parents 1d019706d866
children 2e18cbf3894f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // Check that clang can use a PCH created from libclang.
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 // This test doesn't use -fdisable-module-hash and hence requires that
anatofuz
parents:
diff changeset
4 // CompilerInvocation::getModuleHash() computes exactly the same hash
anatofuz
parents:
diff changeset
5 // for c-index-test and clang, which in turn requires that the both use
anatofuz
parents:
diff changeset
6 // exactly the same resource-dir, even without calling realpath() on it:
anatofuz
parents:
diff changeset
7 // - a/../b/ and b/ are not considered the same
anatofuz
parents:
diff changeset
8 // - on Windows, c:\ and C:\ (only different in case) are not the same
anatofuz
parents:
diff changeset
9
anatofuz
parents:
diff changeset
10 // RUN: rm -rf %t.mcp %t.h.pch
anatofuz
parents:
diff changeset
11 // RUN: %clang_cc1 -fsyntax-only %s -verify
anatofuz
parents:
diff changeset
12 // RUN: c-index-test -write-pch %t.h.pch %s -fmodules -fmodules-cache-path=%t.mcp -Xclang -triple -Xclang x86_64-apple-darwin
anatofuz
parents:
diff changeset
13 // RUN: %clang -fsyntax-only -include %t.h %s -Xclang -verify -fmodules -fmodules-cache-path=%t.mcp -Xclang -detailed-preprocessing-record -Xclang -triple -Xclang x86_64-apple-darwin -Xclang -fallow-pch-with-compiler-errors
anatofuz
parents:
diff changeset
14 // RUN: %clang -x c-header %s -o %t.clang.h.pch -fmodules -fmodules-cache-path=%t.mcp -Xclang -detailed-preprocessing-record -Xclang -triple -Xclang x86_64-apple-darwin -Xclang -fallow-pch-with-compiler-errors -Xclang -verify
anatofuz
parents:
diff changeset
15 // RUN: c-index-test -test-load-source local %s -include %t.clang.h -fmodules -fmodules-cache-path=%t.mcp -Xclang -triple -Xclang x86_64-apple-darwin | FileCheck %s
anatofuz
parents:
diff changeset
16
anatofuz
parents:
diff changeset
17 // FIXME: Still fails on at least some linux boxen.
anatofuz
parents:
diff changeset
18 // REQUIRES: system-darwin
anatofuz
parents:
diff changeset
19
anatofuz
parents:
diff changeset
20 #ifndef HEADER
anatofuz
parents:
diff changeset
21 #define HEADER
anatofuz
parents:
diff changeset
22
anatofuz
parents:
diff changeset
23 void some_function(undeclared_type p); // expected-error{{unknown type name}}
anatofuz
parents:
diff changeset
24
anatofuz
parents:
diff changeset
25 struct S { int x; };
anatofuz
parents:
diff changeset
26
anatofuz
parents:
diff changeset
27 #else
anatofuz
parents:
diff changeset
28 // expected-no-diagnostics
anatofuz
parents:
diff changeset
29
anatofuz
parents:
diff changeset
30 void test(struct S *s) {
anatofuz
parents:
diff changeset
31 // CHECK: [[@LINE+1]]:6: MemberRefExpr=x:[[@LINE-6]]:16
anatofuz
parents:
diff changeset
32 s->x = 0;
anatofuz
parents:
diff changeset
33 }
anatofuz
parents:
diff changeset
34
anatofuz
parents:
diff changeset
35 #endif