diff options
author | Mehdi Amini <mehdi.amini@apple.com> | 2016-11-09 01:45:13 +0000 |
---|---|---|
committer | Mehdi Amini <mehdi.amini@apple.com> | 2016-11-09 01:45:13 +0000 |
commit | b6a11a78794b196cf8cda59d584cbe0d3243c06b (patch) | |
tree | 74cf2737ddc2774f124f18691a3bf8050c9b12ef /llvm/test | |
parent | 0695e5b916c8d4196fd586ce3a08a87f182fae44 (diff) | |
download | bcm5719-llvm-b6a11a78794b196cf8cda59d584cbe0d3243c06b.tar.gz bcm5719-llvm-b6a11a78794b196cf8cda59d584cbe0d3243c06b.zip |
Revert "[ThinLTO] Prevent exporting of locals used/defined in module level asm"
This reverts commit r286297.
Introduces a dependency from libAnalysis to libObject, which I missed
during the review.
llvm-svn: 286329
Diffstat (limited to 'llvm/test')
-rw-r--r-- | llvm/test/LTO/X86/current-section.ll | 3 | ||||
-rw-r--r-- | llvm/test/ThinLTO/X86/Inputs/module_asm2.ll | 12 | ||||
-rw-r--r-- | llvm/test/ThinLTO/X86/module_asm2.ll | 84 |
3 files changed, 0 insertions, 99 deletions
diff --git a/llvm/test/LTO/X86/current-section.ll b/llvm/test/LTO/X86/current-section.ll index 69f8bfaac3b..49eee49ae62 100644 --- a/llvm/test/LTO/X86/current-section.ll +++ b/llvm/test/LTO/X86/current-section.ll @@ -2,7 +2,4 @@ ; RUN: llvm-lto -o %t2 %t1 ; REQUIRES: default_triple -target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" - module asm ".align 4" diff --git a/llvm/test/ThinLTO/X86/Inputs/module_asm2.ll b/llvm/test/ThinLTO/X86/Inputs/module_asm2.ll deleted file mode 100644 index e823277da67..00000000000 --- a/llvm/test/ThinLTO/X86/Inputs/module_asm2.ll +++ /dev/null @@ -1,12 +0,0 @@ -target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" - -define i32 @main({ i64, { i64, i8* }* } %unnamed) #0 { - %1 = call i32 @func1() #1 - %2 = call i32 @func2() #1 - %3 = call i32 @func3() #1 - ret i32 %1 -} -declare i32 @func1() #1 -declare i32 @func2() #1 -declare i32 @func3() #1 diff --git a/llvm/test/ThinLTO/X86/module_asm2.ll b/llvm/test/ThinLTO/X86/module_asm2.ll deleted file mode 100644 index 90ef75fbc5e..00000000000 --- a/llvm/test/ThinLTO/X86/module_asm2.ll +++ /dev/null @@ -1,84 +0,0 @@ -; Test to ensure that uses and defs in module level asm are handled -; appropriately. Specifically, we should conservatively block importing -; of any references to these values, as they can't be renamed. -; RUN: opt -module-summary %s -o %t1.bc -; RUN: opt -module-summary %p/Inputs/module_asm2.ll -o %t2.bc - -; RUN: llvm-lto -thinlto-action=run -exported-symbol=main -exported-symbol=func1 -exported-symbol=func2 -exported-symbol=func3 %t1.bc %t2.bc -; RUN: llvm-nm %t1.bc.thinlto.o | FileCheck %s --check-prefix=NM0 -; RUN: llvm-nm %t2.bc.thinlto.o | FileCheck %s --check-prefix=NM1 - -; RUN: llvm-lto2 %t1.bc %t2.bc -o %t.o -save-temps \ -; RUN: -r=%t1.bc,foo,plx \ -; RUN: -r=%t1.bc,b,pl \ -; RUN: -r=%t1.bc,x,pl \ -; RUN: -r=%t1.bc,func1,pl \ -; RUN: -r=%t1.bc,func2,pl \ -; RUN: -r=%t1.bc,func3,pl \ -; RUN: -r=%t2.bc,main,plx \ -; RUN: -r=%t2.bc,func1,l \ -; RUN: -r=%t2.bc,func2,l \ -; RUN: -r=%t2.bc,func3,l -; RUN: llvm-nm %t.o.0 | FileCheck %s --check-prefix=NM0 -; RUN: llvm-nm %t.o.1 | FileCheck %s --check-prefix=NM1 - -; Check that local values b and x, which are referenced on -; llvm.used and llvm.compiler.used, respectively, are not promoted. -; Similarly, foo which is defined in module level asm should not be -; promoted. -; NM0-DAG: d b -; NM0-DAG: d x -; NM0-DAG: t foo -; NM0-DAG: T func1 -; NM0-DAG: T func2 -; NM0-DAG: T func3 - -; Ensure that foo, b and x are likewise not exported (imported as refs -; into the other module), since they can't be promoted. Additionally, -; referencing functions func1, func2 and func3 should not have been -; imported. -; NM1-NOT: foo -; NM1-NOT: b -; NM1-NOT: x -; NM1-DAG: U func1 -; NM1-DAG: U func2 -; NM1-DAG: U func3 -; NM1-DAG: T main -; NM1-NOT: foo -; NM1-NOT: b -; NM1-NOT: x - -target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" - -@b = internal global i32 1, align 4 -@x = internal global i32 1, align 4 - -@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32* @b to i8*)], section "llvm.metadata" -@llvm.used = appending global [1 x i8*] [i8* bitcast (i32* @x to i8*)], section "llvm.metadata" - -module asm "\09.text" -module asm "\09.type\09foo,@function" -module asm "foo:" -module asm "\09movl b, %eax" -module asm "\09movl x, %edx" -module asm "\09ret " -module asm "\09.size\09foo, .-foo" -module asm "" - -declare i16 @foo() #0 - -define i32 @func1() #1 { - call i16 @foo() - ret i32 1 -} - -define i32 @func2() #1 { - %1 = load i32, i32* @b, align 4 - ret i32 %1 -} - -define i32 @func3() #1 { - %1 = load i32, i32* @x, align 4 - ret i32 %1 -} |