]> granicus.if.org Git - llvm/commitdiff
[PGO] resubmit r268969
authorRong Xu <xur@google.com>
Tue, 10 May 2016 17:45:33 +0000 (17:45 +0000)
committerRong Xu <xur@google.com>
Tue, 10 May 2016 17:45:33 +0000 (17:45 +0000)
Put the test into a target specific directory.

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

lib/Transforms/Instrumentation/PGOInstrumentation.cpp
test/Transforms/PGOProfile/X86/lit.local.cfg [new file with mode: 0644]
test/Transforms/PGOProfile/X86/macho.ll [new file with mode: 0644]

index 90d4ba07abffafaa86b99971b942bf7f8212975f..ef496840fab000c4c0a2b90d41df15974a2a6c60 100644 (file)
@@ -775,7 +775,7 @@ static void createIRLevelProfileFlagVariable(Module &M) {
   IRLevelVersionVariable->setVisibility(GlobalValue::DefaultVisibility);
   Triple TT(M.getTargetTriple());
   if (TT.isOSBinFormatMachO())
-    IRLevelVersionVariable->setLinkage(GlobalValue::LinkOnceODRLinkage);
+    IRLevelVersionVariable->setLinkage(GlobalValue::LinkOnceAnyLinkage);
   else
     IRLevelVersionVariable->setComdat(M.getOrInsertComdat(
         StringRef(INSTR_PROF_QUOTE(IR_LEVEL_PROF_VERSION_VAR))));
diff --git a/test/Transforms/PGOProfile/X86/lit.local.cfg b/test/Transforms/PGOProfile/X86/lit.local.cfg
new file mode 100644 (file)
index 0000000..e71f3cc
--- /dev/null
@@ -0,0 +1,3 @@
+if not 'X86' in config.root.targets:
+    config.unsupported = True
+
diff --git a/test/Transforms/PGOProfile/X86/macho.ll b/test/Transforms/PGOProfile/X86/macho.ll
new file mode 100644 (file)
index 0000000..d2fe65f
--- /dev/null
@@ -0,0 +1,10 @@
+; RUN: opt < %s -pgo-instr-gen -instrprof -S | llc | FileCheck %s --check-prefix=MACHO-DIRECTIVE
+
+target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-apple-macosx10.11.0"
+
+; MACHO-DIRECTIVE: .weak_definition        ___llvm_profile_raw_version
+define i32 @test_macho(i32 %i) {
+entry:
+  ret i32 %i
+}