]> granicus.if.org Git - clang/commitdiff
Revert "Revert r241620 and follow-up commits" and move the initialization
authorAdrian Prantl <aprantl@apple.com>
Wed, 8 Jul 2015 01:00:30 +0000 (01:00 +0000)
committerAdrian Prantl <aprantl@apple.com>
Wed, 8 Jul 2015 01:00:30 +0000 (01:00 +0000)
of the llvm targets from clang/CodeGen into ClangCheck.cpp and CIndex.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241653 91177308-0d34-0410-b5e6-96231b3b80d8

96 files changed:
include/clang/CodeGen/ObjectFilePCHContainerOperations.h [new file with mode: 0644]
lib/Basic/FileManager.cpp
lib/CodeGen/CMakeLists.txt
lib/CodeGen/ObjectFilePCHContainerOperations.cpp [new file with mode: 0644]
lib/Frontend/PCHContainerOperations.cpp
lib/Serialization/ASTReader.cpp
test/ARCMT/check-with-pch.m
test/ARCMT/migrate-on-pch-and-module.m
test/ARCMT/objcmt-with-pch.m
test/ARCMT/objcmt-with-pch.m.result
test/CMakeLists.txt
test/CXX/expr/expr.unary/expr.unary.noexcept/cg.cpp
test/CodeGen/atomic-ops.c
test/CodeGen/big-atomic-ops.c
test/Frontend/ast-codegen.c
test/Headers/xmmintrin.c
test/Index/TestClassForwardDecl.m
test/Index/c-index-api-loadTU-test.m
test/Index/c-index-getCursor-test.m
test/Index/pch-with-module.m
test/Index/print-mangled-name.cpp
test/Modules/compiler_builtins_arm.m
test/Modules/dependency-gen-inferred-map.m
test/Modules/dependency-gen-pch.m
test/Modules/irgen.c
test/Modules/merge-target-features.cpp
test/Modules/pch_container.m [new file with mode: 0644]
test/Modules/self-import-header.m
test/Modules/templates-2.mm
test/Modules/templates.mm
test/Modules/va_list.m
test/OpenMP/atomic_capture_codegen.cpp
test/OpenMP/atomic_read_codegen.c
test/OpenMP/atomic_update_codegen.cpp
test/OpenMP/atomic_write_codegen.c
test/OpenMP/barrier_codegen.cpp
test/OpenMP/cancel_codegen.cpp
test/OpenMP/cancellation_point_codegen.cpp
test/OpenMP/critical_codegen.cpp
test/OpenMP/flush_codegen.cpp
test/OpenMP/for_codegen.cpp
test/OpenMP/for_firstprivate_codegen.cpp
test/OpenMP/for_lastprivate_codegen.cpp
test/OpenMP/for_private_codegen.cpp
test/OpenMP/for_reduction_codegen.cpp
test/OpenMP/for_simd_codegen.cpp
test/OpenMP/master_codegen.cpp
test/OpenMP/ordered_codegen.cpp
test/OpenMP/parallel_codegen.cpp
test/OpenMP/parallel_for_codegen.cpp
test/OpenMP/parallel_for_simd_codegen.cpp
test/OpenMP/parallel_private_codegen.cpp
test/OpenMP/parallel_reduction_codegen.cpp
test/OpenMP/parallel_sections_codegen.cpp
test/OpenMP/sections_codegen.cpp
test/OpenMP/sections_firstprivate_codegen.cpp
test/OpenMP/sections_lastprivate_codegen.cpp
test/OpenMP/sections_private_codegen.cpp
test/OpenMP/sections_reduction_codegen.cpp
test/OpenMP/simd_codegen.cpp
test/OpenMP/single_codegen.cpp
test/OpenMP/single_firstprivate_codegen.cpp
test/OpenMP/single_private_codegen.cpp
test/OpenMP/task_codegen.cpp
test/OpenMP/task_firstprivate_codegen.cpp
test/OpenMP/task_if_codegen.cpp
test/OpenMP/task_private_codegen.cpp
test/OpenMP/taskgroup_codegen.cpp
test/OpenMP/taskwait_codegen.cpp
test/OpenMP/taskyield_codegen.cpp
test/OpenMP/threadprivate_codegen.cpp
test/PCH/__va_list_tag.c
test/PCH/arc.m
test/PCH/asm.c
test/PCH/chain-external-defs.c
test/PCH/chain-trivial.c
test/PCH/cxx-ms-function-specialization-class-scope.cpp
test/PCH/external-defs.c
test/PCH/floating-literal.c
test/PCH/local_static.cpp
test/PCH/pchpch.c
test/PCH/reloc.c
test/PCH/subscripting-literals.m
test/PCH/target-options.c
test/PCH/tentative-defs.c
test/PCH/thread-local.cpp
test/PCH/va_arg.c
test/PCH/va_arg.cpp
test/Sema/x86_64-linux-android.c
tools/clang-check/CMakeLists.txt
tools/clang-check/ClangCheck.cpp
tools/clang-check/Makefile
tools/driver/cc1_main.cpp
tools/libclang/CIndex.cpp
tools/libclang/CMakeLists.txt
tools/libclang/Makefile

diff --git a/include/clang/CodeGen/ObjectFilePCHContainerOperations.h b/include/clang/CodeGen/ObjectFilePCHContainerOperations.h
new file mode 100644 (file)
index 0000000..4540efb
--- /dev/null
@@ -0,0 +1,43 @@
+//===-- CodeGen/ObjectFilePCHContainerOperations.h - ------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_CODEGEN_OBJECT_FILE_PCH_CONTAINER_OPERATIONS_H
+#define LLVM_CLANG_CODEGEN_OBJECT_FILE_PCH_CONTAINER_OPERATIONS_H
+
+#include "clang/Frontend/PCHContainerOperations.h"
+
+namespace clang {
+
+/// \brief A PCHContainerOperations implementation that uses LLVM to
+/// wraps Clang modules inside a COFF, ELF, or Mach-O container.
+class ObjectFilePCHContainerOperations
+  : public PCHContainerOperations {
+  /// \brief Return an ASTConsumer that can be chained with a
+  /// PCHGenerator that produces a wrapper file format
+  /// that also contains full debug info for the module.
+  std::unique_ptr<ASTConsumer>
+    CreatePCHContainerGenerator(
+      DiagnosticsEngine &Diags, const HeaderSearchOptions &HSO,
+      const PreprocessorOptions &PPO, const TargetOptions &TO,
+      const LangOptions &LO, const std::string &MainFileName,
+      const std::string &OutputFileName, llvm::raw_pwrite_stream *OS,
+      std::shared_ptr<PCHBuffer> Buffer) const override;
+
+  /// \brief Initialize an llvm::BitstreamReader with the serialized
+  /// AST inside the PCH container Buffer.
+  void ExtractPCH(llvm::MemoryBufferRef Buffer,
+                  llvm::BitstreamReader &StreamFile) const override;
+
+
+};
+
+}
+
+
+#endif
index c46e2c7db380823190a7f38b0006c6ae9a274396..1a636aefa6391cef41483271dbcae6e85b0be66d 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "clang/Basic/FileManager.h"
 #include "clang/Basic/FileSystemStatCache.h"
+#include "clang/Frontend/PCHContainerOperations.h"
 #include "llvm/ADT/SmallString.h"
 #include "llvm/Config/llvm-config.h"
 #include "llvm/Support/FileSystem.h"
@@ -585,3 +586,5 @@ void FileManager::PrintStats() const {
 
   //llvm::errs() << PagesMapped << BytesOfPagesMapped << FSLookups;
 }
+
+PCHContainerOperations::~PCHContainerOperations() {}
index 5a060b30808b92094383570831ddd71fd63ae9e8..2da4f4961a0000746dc0365667af870d3f278857 100644 (file)
@@ -71,6 +71,7 @@ add_clang_library(clangCodeGen
   ItaniumCXXABI.cpp
   MicrosoftCXXABI.cpp
   ModuleBuilder.cpp
+  ObjectFilePCHContainerOperations.cpp
   SanitizerMetadata.cpp
   TargetInfo.cpp
 
diff --git a/lib/CodeGen/ObjectFilePCHContainerOperations.cpp b/lib/CodeGen/ObjectFilePCHContainerOperations.cpp
new file mode 100644 (file)
index 0000000..7b82579
--- /dev/null
@@ -0,0 +1,192 @@
+//===--- ObjectFilePCHContainerOperations.cpp -----------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "clang/CodeGen/ObjectFilePCHContainerOperations.h"
+#include "CGDebugInfo.h"
+#include "CodeGenModule.h"
+#include "clang/AST/ASTContext.h"
+#include "clang/AST/DeclObjC.h"
+#include "clang/AST/Expr.h"
+#include "clang/AST/RecursiveASTVisitor.h"
+#include "clang/Basic/Diagnostic.h"
+#include "clang/Basic/TargetInfo.h"
+#include "clang/CodeGen/BackendUtil.h"
+#include "clang/Frontend/CodeGenOptions.h"
+#include "clang/Serialization/ASTWriter.h"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/Bitcode/BitstreamReader.h"
+#include "llvm/DebugInfo/DWARF/DWARFContext.h"
+#include "llvm/IR/Constants.h"
+#include "llvm/IR/DataLayout.h"
+#include "llvm/IR/LLVMContext.h"
+#include "llvm/IR/Module.h"
+#include "llvm/Object/COFF.h"
+#include "llvm/Object/ObjectFile.h"
+#include "llvm/Support/TargetRegistry.h"
+#include <memory>
+using namespace clang;
+
+#define DEBUG_TYPE "pchcontainer"
+
+namespace {
+class ModuleContainerGenerator : public ASTConsumer {
+  DiagnosticsEngine &Diags;
+  const std::string MainFileName;
+  ASTContext *Ctx;
+  const HeaderSearchOptions &HeaderSearchOpts;
+  const PreprocessorOptions &PreprocessorOpts;
+  CodeGenOptions CodeGenOpts;
+  const TargetOptions TargetOpts;
+  const LangOptions LangOpts;
+  std::unique_ptr<llvm::LLVMContext> VMContext;
+  std::unique_ptr<llvm::Module> M;
+  std::unique_ptr<CodeGen::CodeGenModule> Builder;
+  raw_pwrite_stream *OS;
+  std::shared_ptr<PCHBuffer> Buffer;
+
+public:
+  ModuleContainerGenerator(
+      DiagnosticsEngine &diags,
+      const HeaderSearchOptions &HSO, const PreprocessorOptions &PPO,
+      const TargetOptions &TO, const LangOptions &LO,
+      const std::string &MainFileName, const std::string &OutputFileName,
+      raw_pwrite_stream *OS, std::shared_ptr<PCHBuffer> Buffer)
+    : Diags(diags), HeaderSearchOpts(HSO), PreprocessorOpts(PPO),
+      TargetOpts(TO), LangOpts(LO), OS(OS),
+      Buffer(Buffer) {
+    // The debug info output isn't affected by CodeModel and
+    // ThreadModel, but the backend expects them to be nonempty.
+    CodeGenOpts.CodeModel = "default";
+    CodeGenOpts.ThreadModel = "single";
+    CodeGenOpts.setDebugInfo(CodeGenOptions::FullDebugInfo);
+    CodeGenOpts.SplitDwarfFile = OutputFileName;
+  }
+
+  virtual ~ModuleContainerGenerator() {}
+
+  void Initialize(ASTContext &Context) override {
+    Ctx = &Context;
+    VMContext.reset(new llvm::LLVMContext());
+    M.reset(new llvm::Module(MainFileName, *VMContext));
+    M->setDataLayout(Ctx->getTargetInfo().getTargetDescription());
+    Builder.reset(new CodeGen::CodeGenModule(*Ctx, HeaderSearchOpts,
+                                             PreprocessorOpts, CodeGenOpts,
+                                             *M, M->getDataLayout(), Diags));
+  }
+
+  /// Emit a container holding the serialized AST.
+  void HandleTranslationUnit(ASTContext &Ctx) override {
+    assert(M && VMContext && Builder);
+    // Delete these on function exit.
+    std::unique_ptr<llvm::LLVMContext> VMContext = std::move(this->VMContext);
+    std::unique_ptr<llvm::Module> M = std::move(this->M);
+    std::unique_ptr<CodeGen::CodeGenModule> Builder = std::move(this->Builder);
+
+    if (Diags.hasErrorOccurred())
+      return;
+
+    M->setTargetTriple(Ctx.getTargetInfo().getTriple().getTriple());
+    M->setDataLayout(Ctx.getTargetInfo().getTargetDescription());
+
+    // Finalize the Builder.
+    if (Builder)
+      Builder->Release();
+
+    // Ensure the target exists.
+    std::string Error;
+    auto Triple = Ctx.getTargetInfo().getTriple();
+    if (!llvm::TargetRegistry::lookupTarget(Triple.getTriple(), Error))
+      llvm::report_fatal_error(Error);
+
+    // Emit the serialized Clang AST into its own section.
+    assert(Buffer->IsComplete && "serialization did not complete");
+    auto &SerializedAST = Buffer->Data;
+    auto Size = SerializedAST.size();
+    auto Int8Ty = llvm::Type::getInt8Ty(*VMContext);
+    auto *Ty = llvm::ArrayType::get(Int8Ty, Size);
+    auto *Data = llvm::ConstantDataArray::
+      getString(*VMContext, StringRef(SerializedAST.data(), Size),
+                /*AddNull=*/false);
+    auto *ASTSym = new llvm::GlobalVariable(
+        *M, Ty, /*constant*/ true, llvm::GlobalVariable::InternalLinkage, Data,
+        "__clang_ast");
+    // The on-disk hashtable needs to be aligned.
+    ASTSym->setAlignment(8);
+
+    // Mach-O also needs a segment name.
+    if (Triple.isOSBinFormatMachO())
+      ASTSym->setSection("__CLANG,__clangast");
+    // COFF has an eight character length limit.
+    else if (Triple.isOSBinFormatCOFF())
+      ASTSym->setSection("clangast");
+    else
+      ASTSym->setSection("__clangast");
+
+    DEBUG({
+        // Print the IR for the PCH container to the debug output.
+        llvm::SmallString<0> Buffer;
+        llvm::raw_svector_ostream OS(Buffer);
+        clang::EmitBackendOutput(Diags, CodeGenOpts, TargetOpts, LangOpts,
+                                 Ctx.getTargetInfo().getTargetDescription(),
+                                 M.get(), BackendAction::Backend_EmitLL, &OS);
+        OS.flush();
+        llvm::dbgs()<<Buffer;
+      });
+
+    // Use the LLVM backend to emit the pch container.
+    clang::EmitBackendOutput(Diags, CodeGenOpts, TargetOpts, LangOpts,
+                             Ctx.getTargetInfo().getTargetDescription(),
+                             M.get(), BackendAction::Backend_EmitObj, OS);
+
+    // Make sure the pch container hits disk.
+    OS->flush();
+
+    // Free the memory for the temporary buffer.
+    llvm::SmallVector<char, 0> Empty;
+    SerializedAST = std::move(Empty);
+  }
+};
+}
+
+std::unique_ptr<ASTConsumer>
+ObjectFilePCHContainerOperations::CreatePCHContainerGenerator(
+    DiagnosticsEngine &Diags, const HeaderSearchOptions &HSO,
+    const PreprocessorOptions &PPO, const TargetOptions &TO,
+    const LangOptions &LO, const std::string &MainFileName,
+    const std::string &OutputFileName, llvm::raw_pwrite_stream *OS,
+    std::shared_ptr<PCHBuffer> Buffer) const {
+ return llvm::make_unique<ModuleContainerGenerator>
+   (Diags, HSO, PPO, TO, LO, MainFileName, OutputFileName, OS, Buffer);
+}
+
+void ObjectFilePCHContainerOperations::ExtractPCH(
+    llvm::MemoryBufferRef Buffer, llvm::BitstreamReader &StreamFile) const {
+  if (auto OF = llvm::object::ObjectFile::createObjectFile(Buffer)) {
+    auto *Obj = OF.get().get();
+    bool IsCOFF = isa<llvm::object::COFFObjectFile>(Obj);
+    // Find the clang AST section in the container.
+    for (auto &Section : OF->get()->sections()) {
+      StringRef Name;
+      Section.getName(Name);
+      if ((!IsCOFF && Name == "__clangast") ||
+          ( IsCOFF && Name ==   "clangast")) {
+        StringRef Buf;
+        Section.getContents(Buf);
+        StreamFile.init((const unsigned char *)Buf.begin(),
+                        (const unsigned char *)Buf.end());
+        return;
+      }
+    }
+  }
+
+  // As a fallback, treat the buffer as a raw AST.
+  StreamFile.init((const unsigned char *)Buffer.getBufferStart(),
+                  (const unsigned char *)Buffer.getBufferEnd());
+  return;
+}
index fd3278b3b145f4aedab41c3664bb00d78998bf43..c749bb5c8db4089c1befcc1c315d025adc86d06f 100644 (file)
@@ -18,8 +18,6 @@
 #include "clang/Lex/ModuleLoader.h"
 using namespace clang;
 
-PCHContainerOperations::~PCHContainerOperations() {}
-
 namespace {
 
 /// \brief A PCHContainerGenerator that writes out the PCH to a flat file.
index 3de1159e78aef8323c4c1459a28761471ba8d68c..3ba13837d451a0ea87d4907735c9a9076ba263fc 100644 (file)
@@ -3976,8 +3976,7 @@ bool ASTReader::readASTFileControlBlock(
 
   // Initialize the stream
   llvm::BitstreamReader StreamFile;
-  StreamFile.init((const unsigned char *)(*Buffer)->getBufferStart(),
-                  (const unsigned char *)(*Buffer)->getBufferEnd());
+  PCHContainerOps.ExtractPCH((*Buffer)->getMemBufferRef(), StreamFile);
   BitstreamCursor Stream(StreamFile);
 
   // Sniff for the signature.
index 1a94dda796b9761d285ab15438c1b5cd2a2ca3fb..5e843ff08df7049692e33dd4434ce3b378df3c04 100644 (file)
@@ -1,5 +1,6 @@
 // RUN: %clang_cc1 -x objective-c -triple x86_64-apple-darwin10 %S/Common.h -emit-pch -o %t.pch
 // RUN: %clang_cc1 -include-pch %t.pch -arcmt-check -verify -triple x86_64-apple-darwin10 -fblocks -Werror %s
+// REQUIRES: x86-registered-target
 
 // rdar://9601437
 @interface I9601437 {
index 51babf6cf48325e5408a094598a806c35944e7d5..42e01ea91a9c7271be98164f77d80a812fee214c 100644 (file)
@@ -1,7 +1,7 @@
 // RUN: rm -rf %t-mcp
 // RUN: %clang_cc1 -objcmt-migrate-subscripting -emit-pch -o %t.pch %s -isysroot %S/Inputs/System -triple x86_64-apple-darwin10 -F %S/Inputs -fmodules -fimplicit-module-maps -fmodules-cache-path=%t-mcp -w
 // RUN: %clang_cc1 -objcmt-migrate-subscripting -include-pch %t.pch %s -migrate -o %t.remap -isysroot %S/Inputs/System -triple x86_64-apple-darwin10 -F %S/Inputs -fmodules -fimplicit-module-maps -fmodules-cache-path=%t-mcp
-
+// REQUIRES: x86-registered-target
 #ifndef HEADER
 #define HEADER
 
index fac42c85123580ad625d53503e1291079a904bd6..61c87a2b007d830e981d5dddda327c760b76050c 100644 (file)
@@ -1,3 +1,4 @@
+// REQUIRES: x86-registered-target
 // RUN: rm -rf %t
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -x objective-c %S/Common.h -emit-pch -o %t.pch
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -objcmt-migrate-literals -objcmt-migrate-subscripting -mt-migrate-directory %t %s -x objective-c -include-pch %t.pch
index 04eadc9d3fa4cfa570acc5fa952560e2956a61a0..7e2570cfc456cdf2d35d56bbae3584164d763457 100644 (file)
@@ -1,3 +1,4 @@
+// REQUIRES: x86-registered-target
 // RUN: rm -rf %t
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -x objective-c %S/Common.h -emit-pch -o %t.pch
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -objcmt-migrate-literals -objcmt-migrate-subscripting -mt-migrate-directory %t %s -x objective-c -include-pch %t.pch
index 591a9272ae6df21e032c5b2426741a01945d15ca..526f129bab587036456de7ffbdb42d5595144392 100644 (file)
@@ -58,7 +58,7 @@ set(CLANG_TEST_PARAMS
 if( NOT CLANG_BUILT_STANDALONE )
   list(APPEND CLANG_TEST_DEPS
     llvm-config
-    llc opt FileCheck count not llvm-symbolizer llvm-profdata
+    llc opt FileCheck count not llvm-symbolizer llvm-profdata llvm-objdump
     )
 endif()
 
index 5c1029f1a3ff5cf9cb843b135f50fa4355bcb024..e299705a4c11ecbc45b27b8e3b9299155bfc86cf 100644 (file)
@@ -1,3 +1,4 @@
+// REQUIRES: x86-registered-target
 // RUN: %clang_cc1 -fcxx-exceptions -fexceptions -triple x86_64-apple-darwin10 -S -emit-llvm -std=c++11 -include %S/ser.h %s -o - | FileCheck %s
 // RUN: %clang_cc1 -fcxx-exceptions -fexceptions -triple x86_64-apple-darwin10 -emit-pch -o %t-ser.pch -std=c++11 -x c++ %S/ser.h
 // RUN: %clang_cc1 -fcxx-exceptions -fexceptions -triple x86_64-apple-darwin10 -S -emit-llvm -std=c++11 -include-pch %t-ser.pch %s -o - | FileCheck %s
index 13ab5f117f93fe3a7713b49f69f81d003519907d..d8f7d28392a57d24fdab02fcdd96362ae7cdb95f 100644 (file)
@@ -1,4 +1,5 @@
 // RUN: %clang_cc1 %s -emit-llvm -o - -ffreestanding -triple=i686-apple-darwin9 | FileCheck %s
+// REQUIRES: x86-registered-target
 
 // Also test serialization of atomic operations here, to avoid duplicating the
 // test.
index 28b7b5d708224d72f9a4b190fac057da4c39acb2..6a7a7001f96d96935ee8d632a566f70a9f035851 100644 (file)
@@ -1,5 +1,5 @@
 // RUN: %clang_cc1 %s -emit-llvm -o - -triple=x86_64-apple-macosx10.9.0 | FileCheck %s
-
+// REQUIRES: x86-registered-target
 // Also test serialization of atomic operations here, to avoid duplicating the
 // test.
 // RUN: %clang_cc1 %s -emit-pch -o %t -triple=x86_64-apple-macosx10.9.0
index b85c5dcf508565784c272ded04450bc328cce1ca..4a3f8a3b79fd83eeaf887c5d9a60d552efc700d2 100644 (file)
@@ -1,3 +1,4 @@
+// REQUIRES: x86-registered-target
 // RUN: %clang -target i386-unknown-unknown -emit-ast -o %t.ast %s
 // RUN: %clang -target i386-unknown-unknown -emit-llvm -S -o - %t.ast | FileCheck %s
 
index 5bf5d4a56683e1376589c377b5423c1c392c10e2..39743c96b783c1b354e2d4997978577715143b74 100644 (file)
@@ -4,7 +4,7 @@
 // RUN: %clang_cc1 %s -ffreestanding -triple x86_64-apple-macosx10.9.0 -emit-llvm -o - \
 // RUN:     -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -isystem %S/Inputs/include \
 // RUN:     | FileCheck %s
-
+// REQUIRES: x86-registered-target
 #include <xmmintrin.h>
 
 // Make sure the last step of _mm_cvtps_pi16 converts <4 x i32> to <4 x i16> by
index 9696a280661dfaecca76b585175312ea6958fd05..284406f6446f8b5e46cda3f0ed85a8a6a7544ffc 100644 (file)
@@ -1,7 +1,7 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fblocks -emit-pch -x objective-c %s -o %t.ast
 // RUN: c-index-test -test-file-scan %t.ast %s | FileCheck -check-prefix=CHECK-scan %s
 // RUN: c-index-test -test-load-tu %t.ast local | FileCheck -check-prefix=CHECK-load %s
-
+// REQUIRES: x86-registered-target
 // This test checks how the @class resolves as a cursor when the @interface is implicitly defined.
 // See TestClassDecl.m for the corresponding test case. (<rdar://problem/7383421>)
 
index c75d5ac6814eb50171bfb1304f8817ce7e7caf0e..cbd742b240b56563933ccd4f643efd4cf9d58b24 100644 (file)
@@ -1,6 +1,6 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fblocks -emit-pch -x objective-c %s -o %t.ast
 // RUN: c-index-test -test-load-tu %t.ast all > %t 2>&1 && FileCheck --input-file=%t %s
-
+// REQUIRES: x86-registered-target
 @interface Foo 
 {
   __attribute__((iboutlet)) id myoutlet;
index c1799026cec9e041fc6e4e0c8d5ab4410cb76274..f368f1f074337d92e5069a4af40a223a7903ad1a 100644 (file)
@@ -166,3 +166,4 @@ void f() {
 // CHECK: [57:1 - 57:10] FunctionDecl=f:57:6 (Definition)
 // CHECK: [58:4 - 58:8] VarDecl=my_var:58:8 (Definition)
 // CHECK: [58:8 - 58:15] macro expansion=CONCAT:55:9
+// REQUIRES: x86-registered-target
index e839c811dab69b38ce46f4f940b94e7a2edaf399..77262d5eb6d1f533a77bffcad9907246b87ee171 100644 (file)
@@ -1,3 +1,4 @@
+// REQUIRES: x86-registered-target
 // RUN: rm -rf %t.cache
 // RUN: c-index-test -write-pch %t.h.pch %s -target x86_64-apple-macosx10.7 -fobjc-arc -fmodules-cache-path=%t.cache -fmodules -F %S/../Modules/Inputs -Xclang -fdisable-module-hash
 // RUN: %clang -fsyntax-only %s -target x86_64-apple-macosx10.7 -include %t.h -fobjc-arc -fmodules-cache-path=%t.cache -fmodules -F %S/../Modules/Inputs \
index b7e79c3f6d659a8c45eb5b024f3c55de3af9e483..d4edc5ff392120c6e947bd74f1365f09a42088a7 100644 (file)
@@ -1,3 +1,4 @@
+// REQUIRES: x86-registered-target
 // RUN: %clang_cc1 -triple i686-pc-linux-gnu -emit-pch %s -o %t_linux.ast
 // RUN: c-index-test -test-print-mangle %t_linux.ast | FileCheck %s --check-prefix=ITANIUM
 
index ccfceaa93f88e23db0035d2a28740be54a0c9c32..23efa4608aa027ea068b84214e3668b706c49818 100644 (file)
@@ -1,5 +1,5 @@
 // RUN: rm -rf %t
 // RUN: %clang_cc1 -fsyntax-only -triple thumbv7-none-linux-gnueabihf -target-abi aapcs -target-cpu cortex-a8 -mfloat-abi hard -std=c99 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -D__need_wint_t %s -verify
 // expected-no-diagnostics
-
+// REQUIRES: arm-registered-target
 @import _Builtin_intrinsics.arm.neon;
index cebfeea4f40b5e36551fc47da543a00c38c1a095..053a653d1748ddd0fe4d573a8c10c314b0a5ddd0 100644 (file)
@@ -1,5 +1,6 @@
 // Test that the virtual file "__inferred_module.map" doesn't show up as dependency.
 
+// REQUIRES: x86-registered-target
 // RUN: rm -rf %t-mcp
 // RUN: %clang_cc1 -isysroot %S/Inputs/System -triple x86_64-apple-darwin10 -dependency-file %t.d -MT %s.o -F %S/Inputs -fsyntax-only -fmodules -fimplicit-module-maps -fmodules-cache-path=%t-mcp %s
 // RUN: FileCheck %s < %t.d
index 697b42947afa8885573f4521fa224c7d805b19bd..4da054ff7dc83d34a75a457270b7269734a33257 100644 (file)
@@ -1,5 +1,6 @@
 // RUN: rm -rf %t-mcp
 // RUN: mkdir -p %t-mcp
+// REQUIRES: x86-registered-target
 
 // RUN: %clang_cc1 -isysroot %S/Inputs/System -triple x86_64-apple-darwin10 -module-file-deps -dependency-file %t.d -MT %s.o -I %S/Inputs -fmodules -fimplicit-module-maps -fdisable-module-hash -fmodules-cache-path=%t-mcp -emit-pch -o %t.pch %s
 // RUN: FileCheck %s < %t.d
index f09cc7b5388fe782bc0be2952a2cfa14bec91ec7..b2eb8b5ce09a38c89b9f8e0d609bffb1f226f446 100644 (file)
@@ -1,3 +1,4 @@
+// REQUIRES: x86-registered-target
 // RUN: rm -rf %t
 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -fmodules-cache-path=%t -emit-module -fmodule-name=irgen -triple x86_64-apple-darwin10 %S/Inputs/module.map
 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -fmodules-cache-path=%t -I %S/Inputs -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s
index 8b82c8a9789b4d79a969e083e9dcdbfe415c927e..938715dd6b11a5b75866b4711ecb7b46a82420b5 100644 (file)
@@ -1,6 +1,6 @@
 // RUN: rm -rf %t
 // RUN: cd %S
-//
+// REQUIRES: x86-registered-target
 // RUN: %clang_cc1 -fmodules -x c++ -fmodules-cache-path=%t \
 // RUN:   -iquote Inputs/merge-target-features \
 // RUN:   -fno-implicit-modules \
diff --git a/test/Modules/pch_container.m b/test/Modules/pch_container.m
new file mode 100644 (file)
index 0000000..095245b
--- /dev/null
@@ -0,0 +1,17 @@
+@import DependsOnModule;
+// REQUIRES: x86-registered-target
+// RUN: rm -rf %t-MachO %t-ELF %t-ELF_SPLIT %t-COFF
+// RUN: %clang_cc1 -triple=x86_64-apple-darwin -fmodules -fimplicit-module-maps -fdisable-module-hash -fmodules-cache-path=%t-MachO -F %S/Inputs %s
+// RUN: %clang_cc1 -triple=x86_64-linux-elf -fmodules -fimplicit-module-maps -fdisable-module-hash -fmodules-cache-path=%t-ELF -F %S/Inputs %s
+// RUN: %clang_cc1 -triple=x86_64-windows-coff -fmodules -fimplicit-module-maps -fdisable-module-hash -fmodules-cache-path=%t-COFF -F %S/Inputs %s
+
+// RUN: llvm-objdump -section-headers %t-MachO/DependsOnModule.pcm %t-ELF/DependsOnModule.pcm %t-COFF/DependsOnModule.pcm | FileCheck %s
+// CHECK: file format Mach-O 64-bit x86-64
+// CHECK: __clangast   {{[0-9a-f]+}} {{[0-9a-f]+}} DATA
+// CHECK: file format ELF64-x86-64
+// CHECK: __clangast   {{[0-9a-f]+}} {{[0-9a-f]+}} DATA
+// CHECK: file format COFF-x86-64
+// CHECK: clangast   {{[0-9a-f]+}} {{[0-9a-f]+}}
+
+
+// RUN: %clang_cc1 -split-dwarf-file t-split.dwo -triple=x86_64-linux-elf -fmodules -fimplicit-module-maps -fdisable-module-hash -fmodules-cache-path=%t-ELF_SPLIT -F %S/Inputs %s -o %t-split.o
index 9b4bd5dee5201cf51dc9194bfcde0771f268ea90..83e5c0104d25a7082e7365920e1079379527a699 100644 (file)
@@ -1,5 +1,5 @@
 // rdar://13840148
-
+// REQUIRES: x86-registered-target
 // RUN: rm -rf %t
 // RUN: %clang -fsyntax-only -isysroot %S/Inputs/System/usr/include -fmodules -fmodules-cache-path=%t \
 // RUN:    -target x86_64-darwin \
index 78d203ab42b492f935f4a83835bb1ed72899c628..9385119679cf0c03786186996c4284ad255f758a 100644 (file)
@@ -2,7 +2,7 @@
 // RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++11 -x objective-c++ -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs -verify %s -Wno-objc-root-class
 // RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++11 -x objective-c++ -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs -emit-llvm %s -o - -Wno-objc-root-class | FileCheck %s
 // expected-no-diagnostics
-
+// REQUIRES: x86-registered-target
 @import templates_top;
 
 struct TestEmitDefaultedSpecialMembers {
index 503f4bb459e03d8bca01125259909337f04a3c60..4c6e4723a3bb380c7672e6765ee99f344e5d8a83 100644 (file)
@@ -2,7 +2,7 @@
 // RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++11 -x objective-c++ -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs -verify %s -Wno-objc-root-class
 // RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++11 -x objective-c++ -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs -emit-llvm %s -o - -Wno-objc-root-class | FileCheck %s
 // expected-no-diagnostics
-
+// REQUIRES: x86-registered-target
 @import templates_left;
 
 void testInlineRedeclEarly() {
index d13b39b48f4af3c137b2afd69d61d5f349ad8336..aa140fb45cd48b756f4735c963968404deb8c12c 100644 (file)
@@ -1,3 +1,4 @@
+// REQUIRES: x86-registered-target
 // RUN: rm -rf %t
 // RUN: %clang_cc1 -triple x86_64-apple-macosx10 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t \
 // RUN:     -fmodules-ignore-macro=PREFIX -DPREFIX -I %S/Inputs/va_list \
index 12f2f3ac4e8138917f1e3aec3db583af4f1e49b0..6dd9f7ab2a41f2c2d32ced7af18d1b3f24032f2f 100644 (file)
@@ -2,7 +2,7 @@
 // RUN: %clang_cc1 -fopenmp -x c -triple x86_64-apple-darwin10 -emit-pch -o %t %s
 // RUN: %clang_cc1 -fopenmp -x c -triple x86_64-apple-darwin10 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
 // expected-no-diagnostics
-
+// REQUIRES: x86-registered-target
 #ifndef HEADER
 #define HEADER
 
index efeec0302d3443b1900dd71af3a2d55760fa8556..fc47c82d891309b97ca28ab63864ca0c2fd8600c 100644 (file)
@@ -2,7 +2,7 @@
 // RUN: %clang_cc1 -fopenmp -x c -triple x86_64-apple-darwin10 -emit-pch -o %t %s
 // RUN: %clang_cc1 -fopenmp -x c -triple x86_64-apple-darwin10 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
 // expected-no-diagnostics
-
+// REQUIRES: x86-registered-target
 #ifndef HEADER
 #define HEADER
 
index b619a07200dcdcd8711a70ca8e79138ef156e7b2..df8b538ee165bc679d2aaef3f1ea96306bb606c4 100644 (file)
@@ -2,7 +2,7 @@
 // RUN: %clang_cc1 -fopenmp -x c -triple x86_64-apple-darwin10 -emit-pch -o %t %s
 // RUN: %clang_cc1 -fopenmp -x c -triple x86_64-apple-darwin10 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
 // expected-no-diagnostics
-
+// REQUIRES: x86-registered-target
 #ifndef HEADER
 #define HEADER
 
index 0016dc86c36adf3a1501a5b27b5105a3def9776a..1ee26b078212a8bcf496818affd2b686cc93262b 100644 (file)
@@ -2,7 +2,7 @@
 // RUN: %clang_cc1 -fopenmp -x c -triple x86_64-apple-darwin10 -emit-pch -o %t %s
 // RUN: %clang_cc1 -fopenmp -x c -triple x86_64-apple-darwin10 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
 // expected-no-diagnostics
-
+// REQUIRES: x86-registered-target
 #ifndef HEADER
 #define HEADER
 
index 9e393ac83360a4300380fae6c37264899fe9bc4e..398b96f44e8a91320bc806361f4ba08c9339c67e 100644 (file)
@@ -2,7 +2,7 @@
 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -emit-pch -o %t %s
 // RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
 // expected-no-diagnostics
-
+// REQUIRES: x86-registered-target
 #ifndef HEADER
 #define HEADER
 
index 6feb5df9dd45abe8d689584a31725b7a34eed669..4bd85a22b1d9749900781f71fe40ad3ee1f67714 100644 (file)
@@ -2,7 +2,7 @@
 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-apple-darwin13.4.0 -emit-pch -o %t %s
 // RUN: %clang_cc1 -fopenmp -std=c++11 -include-pch %t -fsyntax-only -verify %s -triple x86_64-apple-darwin13.4.0 -emit-llvm -o - | FileCheck %s
 // expected-no-diagnostics
-
+// REQUIRES: x86-registered-target
 #ifndef HEADER
 #define HEADER
 
index 47903c1f32771d17405d2f887a80ab894813c506..453393082ce8fc3082ebae50bd28df85f8c3c567 100644 (file)
@@ -2,7 +2,7 @@
 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-apple-darwin13.4.0 -emit-pch -o %t %s
 // RUN: %clang_cc1 -fopenmp -std=c++11 -include-pch %t -fsyntax-only -verify %s -triple x86_64-apple-darwin13.4.0 -emit-llvm -o - | FileCheck %s
 // expected-no-diagnostics
-
+// REQUIRES: x86-registered-target
 #ifndef HEADER
 #define HEADER
 
index 26f5edb38038ce21f256588142839dd9a572fcf1..5cf3446d9f5f9cc96a3baf054c1955a14180d613 100644 (file)
@@ -3,7 +3,7 @@
 // RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
 // RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp -fexceptions -fcxx-exceptions -gline-tables-only -x c++ -emit-llvm %s -o - | FileCheck %s --check-prefix=TERM_DEBUG
 // expected-no-diagnostics
-
+// REQUIRES: x86-registered-target
 #ifndef HEADER
 #define HEADER
 
index 4ebdf522c28c08f702dad64366e862729a00c2fe..cd411cea4573a669aeda4379e1359d51fb759624 100644 (file)
@@ -2,7 +2,7 @@
 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
 // RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -g -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
 // expected-no-diagnostics
-
+// REQUIRES: x86-registered-target
 #ifndef HEADER
 #define HEADER
 
index 30cf484f87a8e06a8c3ff78692a5cf48acdc1b21..082a0d4d884195329354272a736b18dca8d57820 100644 (file)
@@ -4,9 +4,9 @@
 // RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp -fexceptions -fcxx-exceptions -gline-tables-only -x c++ -emit-llvm %s -o - | FileCheck %s --check-prefix=TERM_DEBUG
 //
 // expected-no-diagnostics
+// REQUIRES: x86-registered-target
 #ifndef HEADER
 #define HEADER
-
 // CHECK: [[IDENT_T_TY:%.+]] = type { i32, i32, i32, i32, i8* }
 // CHECK-DAG: [[IMPLICIT_BARRIER_LOC:@.+]] = private unnamed_addr constant %{{.+}} { i32 0, i32 66, i32 0, i32 0, i8*
 // CHECK-DAG: [[I:@.+]] = global i8 1,
index 1ef38661a46f50c4b60cd5906d6003cf03aa2cbe..9be11b974209441789588a40799107667096e718 100644 (file)
@@ -4,6 +4,7 @@
 // RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=LAMBDA %s
 // RUN: %clang_cc1 -verify -fopenmp -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=BLOCKS %s
 // expected-no-diagnostics
+// REQUIRES: x86-registered-target
 #ifndef HEADER
 #define HEADER
 
index 90c40dde2e9a2745f024db5ac7475684708da5d3..7518740207f0f5cbc0e8ec98ec38c0d69bd9d37d 100644 (file)
@@ -4,6 +4,7 @@
 // RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=LAMBDA %s
 // RUN: %clang_cc1 -verify -fopenmp -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=BLOCKS %s
 // expected-no-diagnostics
+// REQUIRES: x86-registered-target
 #ifndef HEADER
 #define HEADER
 
index 8172912d04eef5c767bfbde2c1ffdf1b68297299..2624dd3b7c8048424d2272f435b860c5a63a05ac 100644 (file)
@@ -4,6 +4,7 @@
 // RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DLAMBDA -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck -check-prefix=LAMBDA %s
 // RUN: %clang_cc1 -verify -fopenmp -x c++ -fblocks -DBLOCKS -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck -check-prefix=BLOCKS %s
 // expected-no-diagnostics
+// REQUIRES: x86-registered-target
 #ifndef HEADER
 #define HEADER
 
index 6763686dd0fc811a86f09c827f29f7a0d21c2f2b..1df530091bedf65c7e266986e6d4d06a02c2ec44 100644 (file)
@@ -4,6 +4,7 @@
 // RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=LAMBDA %s
 // RUN: %clang_cc1 -verify -fopenmp -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=BLOCKS %s
 // expected-no-diagnostics
+// REQUIRES: x86-registered-target
 #ifndef HEADER
 #define HEADER
 
index 93611920169575e719e141f14736b8c6c5815428..a5644013868c7fcba37a457efed99248174bcbfd 100644 (file)
@@ -2,7 +2,7 @@
 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
 // RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -g -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
 // RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp -fexceptions -fcxx-exceptions -gline-tables-only -x c++ -emit-llvm %s -o - | FileCheck %s --check-prefix=TERM_DEBUG
-//
+// REQUIRES: x86-registered-target
 // expected-no-diagnostics
 #ifndef HEADER
 #define HEADER
index e6ea21a5cb7b71db8251f4846b250911b6f11e1b..c364c5278bafc8c1c150c8dc6f5e5f5a658e5a84 100644 (file)
@@ -3,7 +3,7 @@
 // RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
 // RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp -fexceptions -fcxx-exceptions -gline-tables-only -x c++ -emit-llvm %s -o - | FileCheck %s --check-prefix=TERM_DEBUG
 // expected-no-diagnostics
-
+// REQUIRES: x86-registered-target
 #ifndef HEADER
 #define HEADER
 
index 768462387a95b8cbcf49a19e158f94194f85b679..ff8a8047cae4e872f4b7c097cbcb267ea6a17552 100644 (file)
@@ -1,7 +1,7 @@
 // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck %s
 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
 // RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
-//
+// REQUIRES: x86-registered-target
 // expected-no-diagnostics
 #ifndef HEADER
 #define HEADER
index 907d1351356cf91b976cfea73ec2ee4c43cf25e5..6486e44a9dac19342dbcc811b11b88b5465c9caf 100644 (file)
@@ -2,9 +2,9 @@
 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
 // RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -g -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix=CHECK-DEBUG %s
 // expected-no-diagnostics
+// REQUIRES: x86-registered-target
 #ifndef HEADER
 #define HEADER
-
 // CHECK-DAG: %ident_t = type { i32, i32, i32, i32, i8* }
 // CHECK-DAG: %struct.anon = type { i32* }
 // CHECK-DAG: %struct.anon.0 = type { i8*** }
index 2a387d9dc376045fd7cd5f5a533ad1a7ce0636df..9fda8404c6e7931c4ddfafee15d765558abae722 100644 (file)
@@ -3,7 +3,7 @@
 // RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
 // RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp -fexceptions -fcxx-exceptions -gline-tables-only -x c++ -emit-llvm %s -o - | FileCheck %s --check-prefix=TERM_DEBUG
 // RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -O1 -fopenmp -emit-llvm %s -o - | FileCheck %s --check-prefix=CLEANUP
-//
+// REQUIRES: x86-registered-target
 // expected-no-diagnostics
 #ifndef HEADER
 #define HEADER
index adde4242014fd8a49a841345706926bd66c46656..eb1e493230e32be17f4af189614a26dbdca394d7 100644 (file)
@@ -2,7 +2,7 @@
 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
 // RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -g -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
 // RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp -fexceptions -fcxx-exceptions -gline-tables-only -x c++ -emit-llvm %s -o - | FileCheck %s --check-prefix=TERM_DEBUG
-//
+// REQUIRES: x86-registered-target
 // expected-no-diagnostics
 #ifndef HEADER
 #define HEADER
index 55f25c67f063bddc72f122c99e7996c53cc24b41..21d9a72a8bdc255b0efe51b4858dc98b1d71bf32 100644 (file)
@@ -4,9 +4,9 @@
 // RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DLAMBDA -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck -check-prefix=LAMBDA %s
 // RUN: %clang_cc1 -verify -fopenmp -x c++ -fblocks -DBLOCKS -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck -check-prefix=BLOCKS %s
 // expected-no-diagnostics
+// REQUIRES: x86-registered-target
 #ifndef HEADER
 #define HEADER
-
 template <class T>
 struct S {
   T f;
index 9ce16e919290e28e20a704a7fd62bc927c7434cc..2ea08f6521de4301f3351f42aea68294b1b85c95 100644 (file)
@@ -3,6 +3,7 @@
 // RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-apple-darwin10 -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
 // RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=LAMBDA %s
 // RUN: %clang_cc1 -verify -fopenmp -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=BLOCKS %s
+// REQUIRES: x86-registered-target
 // expected-no-diagnostics
 #ifndef HEADER
 #define HEADER
index ba1bf6cc56a06f8a3381b55fbfc9c6b95ea5b5e3..2e9e1f95aec51d5ed2fcc62160fa4fd906090117 100644 (file)
@@ -2,7 +2,7 @@
 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -triple x86_64-unknown-unknown -emit-pch -o %t %s
 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -include-pch %t -fsyntax-only -verify %s -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-llvm -o - | FileCheck %s
 // expected-no-diagnostics
-
+// REQUIRES: x86-registered-target
 #ifndef HEADER
 #define HEADER
 // CHECK: [[IMPLICIT_BARRIER_LOC:@.+]] = private unnamed_addr constant %{{.+}} { i32 0, i32 66, i32 0, i32 0, i8*
index d25230a799074fb3e48296d8e365a61e13c6c191..2c257e83ae309624f5be404e2e375bd3a958232a 100644 (file)
@@ -2,7 +2,7 @@
 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -triple x86_64-unknown-unknown -emit-pch -o %t %s
 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -include-pch %t -fsyntax-only -verify %s -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-llvm -o - | FileCheck %s
 // expected-no-diagnostics
-
+// REQUIRES: x86-registered-target
 #ifndef HEADER
 #define HEADER
 // CHECK: [[IMPLICIT_BARRIER_SECTIONS_LOC:@.+]] = private unnamed_addr constant %{{.+}} { i32 0, i32 194, i32 0, i32 0, i8*
index 4ec16ba02d9b8e6b37839dd2cbc5e8f4b5112ffa..46456e620b034583e29bc784c99eed29f5f4af7d 100644 (file)
@@ -4,6 +4,7 @@
 // RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=LAMBDA %s
 // RUN: %clang_cc1 -verify -fopenmp -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=BLOCKS %s
 // expected-no-diagnostics
+// REQUIRES: x86-registered-target
 #ifndef HEADER
 #define HEADER
 
index b57f0b05c0c2bd6282386d80a27351789e136be9..ed5050a57d7a87ca0219e63ea812311786519940 100644 (file)
@@ -4,6 +4,7 @@
 // RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=LAMBDA %s
 // RUN: %clang_cc1 -verify -fopenmp -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=BLOCKS %s
 // expected-no-diagnostics
+// REQUIRES: x86-registered-target
 #ifndef HEADER
 #define HEADER
 
index 90331cbd43a9572531df9dbd59dbd33ea13e965e..5cb1469c62c46a64e4e91abfa6229a6042a23213 100644 (file)
@@ -4,6 +4,7 @@
 // RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DLAMBDA -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck -check-prefix=LAMBDA %s
 // RUN: %clang_cc1 -verify -fopenmp -x c++ -fblocks -DBLOCKS -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck -check-prefix=BLOCKS %s
 // expected-no-diagnostics
+// REQUIRES: x86-registered-target
 #ifndef HEADER
 #define HEADER
 
index a50f04983d4af118ff8eceea13ba07c3eef6c74b..c2b58486bcfacfdfaddec280311adb7c53a2f08c 100644 (file)
@@ -4,6 +4,7 @@
 // RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=LAMBDA %s
 // RUN: %clang_cc1 -verify -fopenmp -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=BLOCKS %s
 // expected-no-diagnostics
+// REQUIRES: x86-registered-target
 #ifndef HEADER
 #define HEADER
 
index ae649d8359a84efffa1a83ee67564fa9ec7390b6..e67ad5d4c7e07323780ac8ce36ef1812fe0946a1 100644 (file)
@@ -2,7 +2,7 @@
 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
 // RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -g -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
 // RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp -fexceptions -fcxx-exceptions -gline-tables-only -x c++ -emit-llvm %s -o - | FileCheck %s --check-prefix=TERM_DEBUG
-//
+// REQUIRES: x86-registered-target
 // expected-no-diagnostics
 #ifndef HEADER
 #define HEADER
index d81739ed9163060d47dd50fdaa4aa739481e968a..db29fd429f6c59f9523141224279c3860d5d0ef2 100644 (file)
@@ -4,7 +4,7 @@
 // RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp -fexceptions -fcxx-exceptions -gline-tables-only -x c++ -emit-llvm %s -o - | FileCheck %s --check-prefix=TERM_DEBUG
 // RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DARRAY -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=ARRAY %s
 // expected-no-diagnostics
-
+// REQUIRES: x86-registered-target
 #ifndef ARRAY
 #ifndef HEADER
 #define HEADER
index 059108b376594ceff780ff9b3fb7448335dd0483..d8d2d260243f03ed616dc6c5aa27834e77eb4e80 100644 (file)
@@ -4,6 +4,7 @@
 // RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=LAMBDA %s
 // RUN: %clang_cc1 -verify -fopenmp -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=BLOCKS %s
 // expected-no-diagnostics
+// REQUIRES: x86-registered-target
 #ifndef HEADER
 #define HEADER
 
index a7fb2ed549371a8a98ea35601452e434a21714e7..e947ca62f413f504e2ff4f871908ca65bdf9ac59 100644 (file)
@@ -4,6 +4,7 @@
 // RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DLAMBDA -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck -check-prefix=LAMBDA %s
 // RUN: %clang_cc1 -verify -fopenmp -x c++ -fblocks -DBLOCKS -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck -check-prefix=BLOCKS %s
 // expected-no-diagnostics
+// REQUIRES: x86-registered-target
 #ifndef HEADER
 #define HEADER
 
index cce0a13bc2e48623be71aa1333f8ff8e706f8f99..139ac505a9f65e9a1e935323f30e2b319b9d7508 100644 (file)
@@ -2,7 +2,7 @@
 // RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-apple-darwin10 -emit-pch -o %t %s
 // RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-apple-darwin10 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
 // expected-no-diagnostics
-
+// REQUIRES: x86-registered-target
 #ifndef HEADER
 #define HEADER
 
index e1358d9ecc6af5cd3e0413f26a18c8a6b08acfa4..3966643e38d246059ac3340c9e50457a4b84251c 100644 (file)
@@ -5,7 +5,7 @@
 // RUN: %clang_cc1 -verify -fopenmp -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=BLOCKS %s
 // RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DARRAY -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=ARRAY %s
 // expected-no-diagnostics
-
+// REQUIRES: x86-registered-target
 // It doesn't pass on win32.
 // REQUIRES: shell
 #ifndef ARRAY
index be9b47b79a41a083b249fb32c723fa8048465b36..d08c27f5a408ff5a129f25d8ec5da78bb6429230 100644 (file)
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck %s
 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-apple-darwin10 -emit-pch -o %t %s
 // RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-apple-darwin10 -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix=CHECK %s
+// REQUIRES: x86-registered-target
 // expected-no-diagnostics
 #ifndef HEADER
 #define HEADER
index 463913f926a4cdc08bcd88e6645bfbd078ec809f..1f6aa437166e80f886b77763020e7846611a19cd 100644 (file)
@@ -5,7 +5,7 @@
 // RUN: %clang_cc1 -verify -fopenmp -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=BLOCKS %s
 // RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DARRAY -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=ARRAY %s
 // expected-no-diagnostics
-
+// REQUIRES: x86-registered-target
 // It doesn't pass on win32. Investigating.
 // REQUIRES: shell
 
index eb45f3187fa5503645396e0d3057294050b1bc4e..c04e4c723b8defefd35060fb44fd149484cc9226 100644 (file)
@@ -3,7 +3,7 @@
 // RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
 // RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp -fexceptions -fcxx-exceptions -gline-tables-only -x c++ -emit-llvm %s -o - | FileCheck %s --check-prefix=TERM_DEBUG
 // expected-no-diagnostics
-
+// REQUIRES: x86-registered-target
 #ifndef HEADER
 #define HEADER
 
index 85f20e80561fced2259cdd43d83144d7684b69c2..7521709f01b689497e5b18bfe0aba8c8e3915fe2 100644 (file)
@@ -2,7 +2,7 @@
 // RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-apple-darwin10 -emit-pch -o %t %s
 // RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-apple-darwin10 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
 // expected-no-diagnostics
-
+// REQUIRES: x86-registered-target
 #ifndef HEADER
 #define HEADER
 
index 6815a0348e1c29d839a20fabdceba529021577f3..759709c33d22e1d16c4e16b91baa21886da9c47e 100644 (file)
@@ -2,7 +2,7 @@
 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -emit-pch -o %t %s
 // RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
 // expected-no-diagnostics
-
+// REQUIRES: x86-registered-target
 #ifndef HEADER
 #define HEADER
 
index eea49443f8c928fb65b668964b6164cc659a2b91..2078094b78949ee552764b93c2e3048836a88140 100644 (file)
@@ -18,7 +18,7 @@
 // CHECK-DEBUG-DAG: [[S4:%.+]] = type { [[INT]], [[INT]] }
 // CHECK-DEBUG-DAG: [[S5:%.+]] = type { [[INT]], [[INT]], [[INT]] }
 // CHECK-DEBUG-DAG: [[SMAIN:%.+]] = type { [[INT]], double, double }
-
+// REQUIRES: x86-registered-target
 struct S1 {
   int a;
   S1()
index efe5c1b36630a72b7b2150afb1de2bcd8d30d773..81cda8963b2328a10518f60af4952579eecc703e 100644 (file)
@@ -1,3 +1,4 @@
+// REQUIRES: x86-registered-target
 // PR13189
 // rdar://problem/11741429
 // Test this without pch.
index 466b3170559606587f44d90b8527da10067d2ff8..63c77778f40a25625e2145f72051abfad285229f 100644 (file)
@@ -1,3 +1,4 @@
+// REQUIRES: x86-registered-target
 // Test this without pch.
 // RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin11 -fobjc-arc -include %S/Inputs/arc.h -fsyntax-only -emit-llvm-only %s
 
index 160829b7a6e710684ae8be7a2eaec026dec2d053..cabd03cac9ae185a8ba73b4e94ad475298587009 100644 (file)
@@ -1,3 +1,4 @@
+// REQUIRES: x86-registered-target
 // Test this without pch.
 // RUN: %clang_cc1 -triple i386-unknown-unknown -include %S/asm.h -fsyntax-only -verify %s
 
index 7422294428650be183ceaa0834a6f95094ab14d9..f7c723338996fbbf74534c50c6a132f5e48bacf5 100644 (file)
@@ -1,3 +1,4 @@
+// REQUIRES: x86-registered-target
 // Test with pch.
 // RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-pch -o %t1.pch %S/Inputs/chain-external-defs1.h
 // RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-pch -o %t2.pch %S/Inputs/chain-external-defs2.h -include-pch %t1.pch
index a0f5827fb91da01111ba8ce8eef4086c54b55cce..4cc7890de04f24d2df1fdc9e879e3889b829d5f0 100644 (file)
@@ -1,2 +1,3 @@
+// REQUIRES: x86-registered-target
 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-pch -o %t1 %S/Inputs/chain-trivial1.h
 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-pch -o %t2 -include-pch %t1 %S/Inputs/chain-trivial2.h
index afbb80b7376e34c1f0e77352ef86640c1f6ba9b3..f97a8d183c7a545514138250d746b835f57d8a3a 100644 (file)
@@ -1,3 +1,4 @@
+// REQUIRES: x86-registered-target
 // RUN: %clang_cc1 -fms-extensions -triple i386-unknown-unknown  -x c++-header -emit-pch -o %t %S/cxx-ms-function-specialization-class-scope.h
 // RUN: %clang_cc1 -fms-extensions -triple i386-unknown-unknown -include-pch %t -fsyntax-only -verify %s 
 // expected-no-diagnostics
index 5c2582a9c361f59fd3b46c61173275bfbbc25a9a..5e906b246bc7c201d6adb9c955fe605c5ff38779 100644 (file)
@@ -1,3 +1,4 @@
+// REQUIRES: x86-registered-target
 // Test with pch.
 // RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-pch -o %t.pch %S/external-defs.h
 // RUN: %clang_cc1 -triple x86_64-apple-darwin9 -include-pch %t.pch -emit-llvm -o %t %s
index 738e45a41517f352292acb1c46ab404b25fba8d5..b5ff6fe84b88ced44974a8945d9fd00092e7d7db 100644 (file)
@@ -1,4 +1,5 @@
 // RUN: %clang_cc1 -triple mips64-none-linux-gnu -emit-pch -o %t %s
+// REQUIRES: mips-registered-target
 // RUN: %clang_cc1 -x ast -ast-print %t | FileCheck %s
 
 // Make sure the semantics of FloatingLiterals are stored correctly in
index 1085d81d3175bc3b5e5c2ccb588fe82c10115bc8..b4131bffde2289abe3778668ea1886cfb1479535 100644 (file)
@@ -1,3 +1,4 @@
+// REQUIRES: x86-registered-target
 // Test this without PCH.
 // RUN: %clang_cc1 -triple x86_64-apple-macosx10.9.0 -include %S/local_static.h -fsyntax-only %s -emit-llvm -o %t.no_pch.ll %s
 // RUN: FileCheck --input-file %t.no_pch.ll %s
index d68a6ad4aee62da2d432f511431c2894408c0a46..5ea661abd55542fa0d73333f0bcce6fc1fb57373 100644 (file)
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -triple i386-unknown-unknown -emit-pch -o %t1 %S/pchpch1.h
 // RUN: %clang_cc1 -triple i386-unknown-unknown -emit-pch -o %t2 %S/pchpch2.h -include-pch %t1
 // RUN: %clang_cc1 -triple i386-unknown-unknown -fsyntax-only %s -include-pch %t2
+// REQUIRES: x86-registered-target
 
 // The purpose of this test is to make sure that a PCH created while including
 // an existing PCH can be loaded.
index 8dabb8b03d0b6547ee421e2ad65a0386dbc4ba84..bf70ab6f6922276c3a1f64c537287c43231b7887 100644 (file)
@@ -3,6 +3,7 @@
 // RUN: %clang -target x86_64-apple-darwin10 -fsyntax-only \
 // RUN:   -include-pch %t -isysroot %S/libroot %s -Xclang -verify
 // RUN: not %clang -target x86_64-apple-darwin10 -include-pch %t %s
+// REQUIRES: x86-registered-target
 
 #include <reloc.h>
 
index 725e5802a5ddfb977c87eab901708d044491c6d7..52491dbc2008f3465e95ea66fa57f291cea1f9ee 100644 (file)
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -o %t.nopch.ll %s
 // RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-pch -o %t.pch %s
 // RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -o %t.pch.ll %s -include-pch %t.pch
+// REQUIRES: x86-registered-target
 // RUN: diff %t.nopch.ll %t.pch.ll
 
 #ifndef HEADER
index 2b85efe07abfac4c18d8d75f349bc2a3c1c06426..06a09502f9ab07a5929270b430ea72d2335813c3 100644 (file)
@@ -1,5 +1,6 @@
 // RUN: %clang_cc1 -triple=x86_64-apple-darwin9 -emit-pch -o %t.pch %S/target-options.h
 // RUN: not %clang_cc1 -triple=x86_64-unknown-freebsd7.0 -include-pch %t.pch %s -emit-llvm -o - > %t.err 2>&1
 // RUN: FileCheck %s < %t.err
+// REQUIRES: x86-registered-target
 
 // CHECK: for the target
index 42882307dc73f99ded7b616624f12e31068d5fde..7163316a93dea162793b29c112511d6812c76406 100644 (file)
@@ -1,6 +1,7 @@
 // Test with pch.
 // RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-pch -o %t.pch %S/tentative-defs.h
 // RUN: %clang_cc1 -triple x86_64-apple-darwin9 -include-pch %t.pch -verify -emit-llvm -o %t %s
+// REQUIRES: x86-registered-target
 
 // RUN: grep "@variable = common global i32 0" %t | count 1
 // RUN: grep "@incomplete_array = common global .*1 x i32" %t | count 1
index f65c12af0925afacac5c856f7d8b75197a4b948d..ab37f7b3f7ede5d3510ff3a0c1406acacb700888 100644 (file)
@@ -1,6 +1,6 @@
 // RUN: %clang_cc1 -pedantic-errors -std=c++11 -triple x86_64-linux-gnu -emit-pch %s -o %t
 // RUN: %clang_cc1 -pedantic-errors -std=c++11 -triple x86_64-linux-gnu -include-pch %t -verify %s
-
+// REQUIRES: x86-registered-target
 #ifndef HEADER_INCLUDED
 
 #define HEADER_INCLUDED
index 1fb2a838e4f73e21739dbf22b9bbd567c17f04fc..dba9eea8de42d183f2cd708052a4695aca7ee81c 100644 (file)
@@ -1,5 +1,6 @@
 // Test this without pch.
 // RUN: %clang_cc1 -triple=x86_64-unknown-freebsd7.0 -include %S/va_arg.h %s -emit-llvm -o -
+// REQUIRES: x86-registered-target
 
 // Test with pch.
 // RUN: %clang_cc1 -triple=x86_64-unknown-freebsd7.0 -emit-pch -o %t %S/va_arg.h
index 7c8dc6b316f3005b4fc3afcbe34da18000207792..0b3c3b107c06c811b0a6da72b05bb4f7dedd2a84 100644 (file)
@@ -1,5 +1,6 @@
 // Test this without pch.
 // RUN: %clang_cc1 -triple=x86_64-unknown-freebsd7.0 -include %S/Inputs/va_arg.h %s -emit-llvm -o -
+// REQUIRES: x86-registered-target
 
 // Test with pch.
 // RUN: %clang_cc1 -triple=x86_64-unknown-freebsd7.0 -emit-pch -x c++-header -o %t %S/Inputs/va_arg.h
index e09d50ca079cc6608224b63a552026dea2e7eff3..252570579f6076f715a7741def3cfeda53a6fd10 100644 (file)
@@ -1,6 +1,6 @@
 // RUN: %clang_cc1 -triple x86_64-linux-android -emit-pch -o %t %s
 // RUN: %clang_cc1 -x ast -ast-print %t | FileCheck %s
-
+// REQUIRES: x86-registered-target
 extern int a1_0[sizeof(long double) == 16 ? 1 : -1];
 extern int a1_i[__alignof(long double) == 16 ? 1 : -1];
 
index 8b9cd888c8c76fd2889b1493941af8a2379f806e..7253a42ab8e41f249fb21aaec16201404ee0e8d8 100644 (file)
@@ -1,8 +1,24 @@
-set(LLVM_LINK_COMPONENTS
+set( LLVM_LINK_COMPONENTS
+  ${LLVM_TARGETS_TO_BUILD}
+  Analysis
+  CodeGen
+  Core
+  IPA
+  IPO
+  InstCombine
+  Instrumentation
+  MC
+  MCParser
+  ObjCARCOpts
   Option
+  ScalarOpts
   Support
+  TransformUtils
+  Vectorize
   )
 
+set(LLVM_NO_DEAD_STRIP 1)
+
 add_clang_executable(clang-check
   ClangCheck.cpp
   )
@@ -11,6 +27,7 @@ target_link_libraries(clang-check
   clangAST
   clangBasic
   clangDriver
+  clangCodeGen
   clangFrontend
   clangRewriteFrontend
   clangStaticAnalyzerFrontend
index 7992026a7ccf4f7f2c844c8ffc56245f1e321b8f..2682e0fcd83f4973e4ced20a5aba30f8f0f7437a 100644 (file)
@@ -17,6 +17,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "clang/AST/ASTConsumer.h"
+#include "clang/CodeGen/ObjectFilePCHContainerOperations.h"
 #include "clang/Driver/Options.h"
 #include "clang/Frontend/ASTConsumers.h"
 #include "clang/Frontend/CompilerInstance.h"
@@ -29,6 +30,7 @@
 #include "llvm/Option/OptTable.h"
 #include "llvm/Support/Path.h"
 #include "llvm/Support/Signals.h"
+#include "llvm/Support/TargetSelect.h"
 
 using namespace clang::driver;
 using namespace clang::tooling;
@@ -149,9 +151,17 @@ public:
 
 int main(int argc, const char **argv) {
   llvm::sys::PrintStackTraceOnErrorSignal();
+
+  // Initialize targets for clang module support.
+  llvm::InitializeAllTargets();
+  llvm::InitializeAllTargetMCs();
+  llvm::InitializeAllAsmPrinters();
+  llvm::InitializeAllAsmParsers();
+
   CommonOptionsParser OptionsParser(argc, argv, ClangCheckCategory);
   ClangTool Tool(OptionsParser.getCompilations(),
-                 OptionsParser.getSourcePathList());
+                 OptionsParser.getSourcePathList(),
+                 std::make_shared<clang::ObjectFilePCHContainerOperations>());
 
   // Clear adjusters because -fsyntax-only is inserted by the default chain.
   Tool.clearArgumentsAdjusters();
index e98a131de5a9edd8ce4bfea10940f3fef62c5636..da010ab1f32a54c6f787c94e2701340392d862e6 100644 (file)
@@ -15,11 +15,14 @@ TOOLNAME = clang-check
 TOOL_NO_EXPORTS = 1
 
 include $(CLANG_LEVEL)/../../Makefile.config
-LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader support mc option
-USEDLIBS = clangFrontend.a clangSerialization.a clangDriver.a \
+LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader ipo objcarcopts \
+                   instrumentation bitwriter support mc option
+USEDLIBS = clangFrontend.a clangCodeGen.a clangIndex.a \
+           clangSerialization.a clangDriver.a \
            clangTooling.a clangParse.a clangSema.a \
            clangStaticAnalyzerFrontend.a clangStaticAnalyzerCheckers.a \
            clangStaticAnalyzerCore.a clangAnalysis.a clangRewriteFrontend.a \
-           clangRewrite.a clangEdit.a clangAST.a clangLex.a clangBasic.a
+           clangRewrite.a clangEdit.a clangAST.a clangLex.a \
+           clangBasic.a
 
 include $(CLANG_LEVEL)/Makefile
index 972bf5bf3e10d731d3ea3221335888641d6290c2..65f845ddc458b60d0c4b69bd130c7a7df79c833d 100644 (file)
@@ -14,7 +14,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/Option/Arg.h"
-#include "clang/Frontend/PCHContainerOperations.h"
+#include "clang/CodeGen/ObjectFilePCHContainerOperations.h"
 #include "clang/Driver/DriverDiagnostic.h"
 #include "clang/Driver/Options.h"
 #include "clang/Frontend/CompilerInstance.h"
@@ -65,8 +65,8 @@ void initializePollyPasses(llvm::PassRegistry &Registry);
 #endif
 
 int cc1_main(ArrayRef<const char *> Argv, const char *Argv0, void *MainAddr) {
-  std::unique_ptr<CompilerInstance> Clang(
-      new CompilerInstance(std::make_shared<RawPCHContainerOperations>()));
+  std::unique_ptr<CompilerInstance> Clang(new CompilerInstance(
+      std::make_shared<ObjectFilePCHContainerOperations>()));
   IntrusiveRefCntPtr<DiagnosticIDs> DiagID(new DiagnosticIDs());
 
   // Initialize targets first, so that --version shows registered targets.
index df0ed2ad65ddc9575e212a50027224c2754193d3..49b9da23865aab9efcac56bed10b42d34ec71151 100644 (file)
@@ -29,6 +29,7 @@
 #include "clang/Basic/DiagnosticIDs.h"
 #include "clang/Basic/TargetInfo.h"
 #include "clang/Basic/Version.h"
+#include "clang/CodeGen/ObjectFilePCHContainerOperations.h"
 #include "clang/Frontend/ASTUnit.h"
 #include "clang/Frontend/CompilerInstance.h"
 #include "clang/Frontend/FrontendDiagnostic.h"
@@ -53,6 +54,7 @@
 #include "llvm/Support/Program.h"
 #include "llvm/Support/SaveAndRestore.h"
 #include "llvm/Support/Signals.h"
+#include "llvm/Support/TargetSelect.h"
 #include "llvm/Support/Threading.h"
 #include "llvm/Support/Timer.h"
 #include "llvm/Support/raw_ostream.h"
@@ -2876,7 +2878,14 @@ CXIndex clang_createIndex(int excludeDeclarationsFromPCH,
   // registered once.
   (void)*RegisterFatalErrorHandlerOnce;
 
-  CIndexer *CIdxr = new CIndexer();
+  // Initialize targets for clang module support.
+  llvm::InitializeAllTargets();
+  llvm::InitializeAllTargetMCs();
+  llvm::InitializeAllAsmPrinters();
+  llvm::InitializeAllAsmParsers();
+
+  CIndexer *CIdxr =
+      new CIndexer(std::make_shared<ObjectFilePCHContainerOperations>());
   if (excludeDeclarationsFromPCH)
     CIdxr->setOnlyLocalDecls();
   if (displayDiagnostics)
index 26f88a97c5744af648e54b436171d9b3f4090704..407a5c4d4e7930f12edfaa53d35a9833d41d046f 100644 (file)
@@ -37,9 +37,14 @@ set(SOURCES
   ../../include/clang-c/Index.h
   )
 
+set( LLVM_LINK_COMPONENTS
+  ${LLVM_TARGETS_TO_BUILD}
+  )
+
 set(LIBS
   clangAST
   clangBasic
+  clangCodeGen
   clangFrontend
   clangIndex
   clangLex
index 97f663cde478d6312afd5e77df5eae199c68397d..84914e0f4609f5c4e923bdf5c1f54b8226778d58 100644 (file)
@@ -16,19 +16,21 @@ LINK_LIBS_IN_SHARED = 1
 SHARED_LIBRARY = 1
 
 include $(CLANG_LEVEL)/../../Makefile.config
-LINK_COMPONENTS := AsmParser BitReader Core MC MCParser Option Support
+LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader bitwriter core \
+                   instrumentation ipo mc mcparser objcarcopts option support \
+                   object
 USEDLIBS = clangIndex.a clangARCMigrate.a \
           clangRewriteFrontend.a \
           clangFormat.a \
           clangTooling.a clangToolingCore.a \
-          clangFrontend.a clangDriver.a \
+          clangFrontend.a clangCodeGen.a clangDriver.a \
           clangSerialization.a \
           clangParse.a clangSema.a \
           clangStaticAnalyzerCheckers.a clangStaticAnalyzerCore.a \
           clangRewrite.a \
           clangAnalysis.a clangEdit.a \
           clangASTMatchers.a \
-          clangAST.a clangLex.a clangBasic.a \
+          clangAST.a clangLex.a clangBasic.a
 
 include $(CLANG_LEVEL)/Makefile