Initial checkin of crtend.o implementation
[oota-llvm.git] / runtime / GCCLibraries / crtend / listend.ll
index 2a334999e2568bda31f5ea1a41d842a307e55d7f..3614bab7683e9aa337d913a79cbdb944c8111ac6 100644 (file)
@@ -1,5 +1,26 @@
 ; global_ctors/global_dtors terminator: this is used to add a terminating null
 ; value to the initialization list.
 
-%llvm.global_ctors = appending global [1 x { int, void ()* }] [ { int, void ()* } { int 2147483647, void ()* null } ]
-%llvm.global_ctors = appending global [1 x { int, void ()* }] [ { int, void ()* } { int 2147483647, void ()* null } ]
+target endian = little
+target pointersize = 32
+
+%struct.TorRec = type { int, void ()* }
+
+%llvm.global_ctors = appending global [1 x %struct.TorRec] [
+    %struct.TorRec { int 2147483647, void ()* null }
+  ]
+
+%llvm.global_dtors = appending global [1 x %struct.TorRec] [
+    %struct.TorRec { int 2147483647, void ()* null }
+  ]
+
+implementation
+
+%struct.TorRec* %__llvm_getGlobalCtors() {
+  ret %struct.TorRec* getelementptr ([1 x %struct.TorRec]* %llvm.global_ctors,
+                                     long 0, long 0)
+}
+%struct.TorRec* %__llvm_getGlobalDtors() {
+  ret %struct.TorRec* getelementptr ([1 x %struct.TorRec]* %llvm.global_dtors,
+                                     long 0, long 0)
+}