summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2013-09-05 00:02:25 +0000
committerEli Friedman <eli.friedman@gmail.com>2013-09-05 00:02:25 +0000
commit276dd188c428d4fb1b3e887fe70a929a71892bf9 (patch)
treeeb49076c4c96fbb6f2efe12c9410cfe119af18e0 /clang/test/Modules
parent5c30024fd42868e0850cec1e822671187315c8df (diff)
downloadbcm5719-llvm-276dd188c428d4fb1b3e887fe70a929a71892bf9.tar.gz
bcm5719-llvm-276dd188c428d4fb1b3e887fe70a929a71892bf9.zip
Note when a decl is used in AST files.
When an AST file is built based on another AST file, it can use a decl from the fist file, and therefore mark the "isUsed" bit. We need to note this in the AST file so that the bit is set correctly when the second AST file is loaded. This patch introduces the distinction between setIsUsed() and markUsed() so that we don't call into the ASTMutationListener callback when it wouldn't be appropriate. Fixes PR16635. llvm-svn: 190016
Diffstat (limited to 'clang/test/Modules')
-rw-r--r--clang/test/Modules/Inputs/System/usr/include/stdio.h2
-rw-r--r--clang/test/Modules/Inputs/pch-used.h2
-rw-r--r--clang/test/Modules/pch-used.m8
3 files changed, 11 insertions, 1 deletions
diff --git a/clang/test/Modules/Inputs/System/usr/include/stdio.h b/clang/test/Modules/Inputs/System/usr/include/stdio.h
index 9a7b1063032..f41e09c35a4 100644
--- a/clang/test/Modules/Inputs/System/usr/include/stdio.h
+++ b/clang/test/Modules/Inputs/System/usr/include/stdio.h
@@ -1,3 +1,3 @@
typedef struct { int id; } FILE;
int fprintf(FILE*restrict, const char* restrict format, ...);
-
+extern FILE *__stderrp;
diff --git a/clang/test/Modules/Inputs/pch-used.h b/clang/test/Modules/Inputs/pch-used.h
new file mode 100644
index 00000000000..60e0097ea90
--- /dev/null
+++ b/clang/test/Modules/Inputs/pch-used.h
@@ -0,0 +1,2 @@
+@import cstd.stdio;
+static inline void SPXTrace() { fprintf(__stderrp, ""); }
diff --git a/clang/test/Modules/pch-used.m b/clang/test/Modules/pch-used.m
new file mode 100644
index 00000000000..56961ba404c
--- /dev/null
+++ b/clang/test/Modules/pch-used.m
@@ -0,0 +1,8 @@
+// RUN: rm -rf %t
+// RUN: mkdir %t
+// RUN: %clang_cc1 -x objective-c-header -emit-pch %S/Inputs/pch-used.h -o %t/pch-used.h.pch -fmodules -fmodules-cache-path=%t/cache -O0 -isystem %S/Inputs/System/usr/include
+// RUN: %clang_cc1 %s -include-pch %t/pch-used.h.pch -fmodules -fmodules-cache-path=%t/cache -O0 -isystem %S/Inputs/System/usr/include -emit-llvm -o - | FileCheck %s
+
+void f() { SPXTrace(); }
+
+// CHECK: define internal void @SPXTrace
OpenPOWER on IntegriCloud