summaryrefslogtreecommitdiffstats
path: root/llvm/test/DebugInfo/COFF
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2019-05-15 02:35:32 +0000
committerFangrui Song <maskray@google.com>2019-05-15 02:35:32 +0000
commitf4dfd63c74899e2953b176de2174ae7a8924a72c (patch)
tree10b8dd0ca599015981cbea658f927847791c4d5b /llvm/test/DebugInfo/COFF
parentbd3adfe5e3bcb6f8f16166d1fd8a3f3c4fd70307 (diff)
downloadbcm5719-llvm-f4dfd63c74899e2953b176de2174ae7a8924a72c.tar.gz
bcm5719-llvm-f4dfd63c74899e2953b176de2174ae7a8924a72c.zip
[IR] Disallow llvm.global_ctors and llvm.global_dtors of the 2-field form in textual format
The 3-field form was introduced by D3499 in 2014 and the legacy 2-field form was planned to be removed in LLVM 4.0 For the textual format, this patch migrates the existing 2-field form to use the 3-field form and deletes the compatibility code. test/Verifier/global-ctors-2.ll checks we have a friendly error message. For bitcode, lib/IR/AutoUpgrade UpgradeGlobalVariables will upgrade the 2-field form (add i8* null as the third field). Reviewed By: rnk, dexonsmith Differential Revision: https://reviews.llvm.org/D61547 llvm-svn: 360742
Diffstat (limited to 'llvm/test/DebugInfo/COFF')
-rw-r--r--llvm/test/DebugInfo/COFF/asan-module-ctor.ll2
-rw-r--r--llvm/test/DebugInfo/COFF/asan-module-without-functions.ll4
2 files changed, 3 insertions, 3 deletions
diff --git a/llvm/test/DebugInfo/COFF/asan-module-ctor.ll b/llvm/test/DebugInfo/COFF/asan-module-ctor.ll
index 8d1f811ad72..83b27305f3f 100644
--- a/llvm/test/DebugInfo/COFF/asan-module-ctor.ll
+++ b/llvm/test/DebugInfo/COFF/asan-module-ctor.ll
@@ -21,7 +21,7 @@
target datalayout = "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32"
target triple = "i686-pc-win32"
-@llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 1, void ()* @asan.module_ctor }]
+@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 1, void ()* @asan.module_ctor, i8* null }]
; Function Attrs: nounwind sanitize_address
define i32 @foo() #0 !dbg !4 {
diff --git a/llvm/test/DebugInfo/COFF/asan-module-without-functions.ll b/llvm/test/DebugInfo/COFF/asan-module-without-functions.ll
index 9e3c25e80a8..f009e301558 100644
--- a/llvm/test/DebugInfo/COFF/asan-module-without-functions.ll
+++ b/llvm/test/DebugInfo/COFF/asan-module-without-functions.ll
@@ -14,11 +14,11 @@ target datalayout = "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32"
target triple = "i686-pc-win32"
@c = global { i8, [63 x i8] } { i8 42, [63 x i8] zeroinitializer }, align 32
-@llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 1, void ()* @asan.module_ctor }]
+@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 1, void ()* @asan.module_ctor, i8* null }]
@___asan_gen_ = private constant [7 x i8] c"asan.c\00", align 1
@___asan_gen_1 = private unnamed_addr constant [2 x i8] c"c\00", align 1
@0 = internal global [1 x { i32, i32, i32, i32, i32, i32 }] [{ i32, i32, i32, i32, i32, i32 } { i32 ptrtoint ({ i8, [63 x i8] }* @c to i32), i32 1, i32 64, i32 ptrtoint ([2 x i8]* @___asan_gen_1 to i32), i32 ptrtoint ([7 x i8]* @___asan_gen_ to i32), i32 0 }]
-@llvm.global_dtors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 1, void ()* @asan.module_dtor }]
+@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 1, void ()* @asan.module_dtor, i8* null }]
define internal void @asan.module_ctor() {
call void @__asan_init_v3()
OpenPOWER on IntegriCloud