Revert "GlobalDCE: Delete available_externally initializers if it allows removing...
[oota-llvm.git] / test / Transforms / GlobalDCE / externally_available.ll
index 3dbada841f90b5d1eb899ac017d80fa596c04b04..cc88cb10dcc6257b4fe865e24d2d92db4adcb9d9 100644 (file)
@@ -1,43 +1,10 @@
-; RUN: opt < %s -globaldce -S | FileCheck %s
+; RUN: opt < %s -globaldce -S | not grep test_
 
 ; test_function should not be emitted to the .s file.
-; CHECK-NOT: @test_function
 define available_externally i32 @test_function() {
   ret i32 4
 }
 
 ; test_global should not be emitted to the .s file.
-; CHECK-NOT: @test_global
 @test_global = available_externally global i32 4
 
-; CHECK: @x = external constant void ()*
-@x = available_externally constant void()* @f
-; CHECK: @y = external constant i32
-@y = available_externally constant i32 ptrtoint (void()* @g to i32)
-; @h is still alive, so don't remove the initializer too eagerly.
-; CHECK: @z = available_externally constant i8 ptrtoint (void (i8)* @h to i8)
-@z = available_externally constant i8 ptrtoint (void(i8)* @h to i8)
-
-; CHECK-NOT: @f
-define linkonce_odr void @f() {
-  ret void
-}
-
-; CHECK-NOT: @g
-define linkonce_odr void @g() {
-  ret void
-}
-
-; CHECK: define linkonce_odr void @h
-define linkonce_odr void @h(i8) {
-  ret void
-}
-
-define i32 @main() {
-  %f = load void()** @x
-  call void %f()
-  %g = load i32* @y
-  %h = load i8* @z
-  call void @h(i8 %h)
-  ret i32 %g
-}