]> granicus.if.org Git - llvm/commitdiff
LowerTypeTests: Change a few vtable globals in tests to constants.
authorPeter Collingbourne <peter@pcc.me.uk>
Thu, 9 Feb 2017 01:48:24 +0000 (01:48 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Thu, 9 Feb 2017 01:48:24 +0000 (01:48 +0000)
It turns out that some of our negative tests were not in fact providing the
test coverage we expected: they were passing because the vtables were failing
an early check that they were constant. Fix this by changing the globals in
these tests to constants.

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

test/Transforms/WholeProgramDevirt/bad-read-from-vtable.ll
test/Transforms/WholeProgramDevirt/vcp-accesses-memory.ll
test/Transforms/WholeProgramDevirt/vcp-no-this.ll
test/Transforms/WholeProgramDevirt/vcp-non-constant-arg.ll
test/Transforms/WholeProgramDevirt/vcp-too-wide-ints.ll
test/Transforms/WholeProgramDevirt/vcp-type-mismatch.ll
test/Transforms/WholeProgramDevirt/vcp-uses-this.ll

index 4885be7775663d44f29b4accecc1d0b32b345e36..e5d0e74b22e2d8f8f5de6d9fee82612845d3263f 100644 (file)
@@ -3,8 +3,8 @@
 target datalayout = "e-p:64:64"
 target triple = "x86_64-unknown-linux-gnu"
 
-@vt1 = global [2 x i8*] [i8* zeroinitializer, i8* bitcast (void (i8*)* @vf to i8*)], !type !0
-@vt2 = global i8* bitcast (void (i8*)* @vf to i8*), !type !1
+@vt1 = constant [2 x i8*] [i8* zeroinitializer, i8* bitcast (void (i8*)* @vf to i8*)], !type !0
+@vt2 = constant i8* bitcast (void (i8*)* @vf to i8*), !type !1
 
 define void @vf(i8* %this) {
   ret void
index b5d51f2d4637960267ee952a9be73f8e563a1f03..c4aad65810021270d100608fce35b2c151d5f811 100644 (file)
@@ -3,8 +3,8 @@
 target datalayout = "e-p:64:64"
 target triple = "x86_64-unknown-linux-gnu"
 
-@vt1 = global [1 x i8*] [i8* bitcast (i32 (i8*, i32)* @vf1 to i8*)], !type !0
-@vt2 = global [1 x i8*] [i8* bitcast (i32 (i8*, i32)* @vf2 to i8*)], !type !0
+@vt1 = constant [1 x i8*] [i8* bitcast (i32 (i8*, i32)* @vf1 to i8*)], !type !0
+@vt2 = constant [1 x i8*] [i8* bitcast (i32 (i8*, i32)* @vf2 to i8*)], !type !0
 
 define i32 @vf1(i8* %this, i32 %arg) {
   ret i32 %arg
index c564665471cfc3e020651213d4953b8b0b11d0d0..ce76c8e6797e381e818fabcc6942f919e9aee2ee 100644 (file)
@@ -3,8 +3,8 @@
 target datalayout = "e-p:64:64"
 target triple = "x86_64-unknown-linux-gnu"
 
-@vt1 = global [1 x i8*] [i8* bitcast (i32 ()* @vf1 to i8*)], !type !0
-@vt2 = global [1 x i8*] [i8* bitcast (i32 ()* @vf2 to i8*)], !type !0
+@vt1 = constant [1 x i8*] [i8* bitcast (i32 ()* @vf1 to i8*)], !type !0
+@vt2 = constant [1 x i8*] [i8* bitcast (i32 ()* @vf2 to i8*)], !type !0
 
 define i32 @vf1() readnone {
   ret i32 1
index 197c923c3a1cb769c7f53754d3f9b9da502a9e56..cc2ff33296a9988f743732bb02789fc3decb136e 100644 (file)
@@ -3,8 +3,8 @@
 target datalayout = "e-p:64:64"
 target triple = "x86_64-unknown-linux-gnu"
 
-@vt1 = global [1 x i8*] [i8* bitcast (i32 (i8*, i32)* @vf1 to i8*)], !type !0
-@vt2 = global [1 x i8*] [i8* bitcast (i32 (i8*, i32)* @vf2 to i8*)], !type !0
+@vt1 = constant [1 x i8*] [i8* bitcast (i32 (i8*, i32)* @vf1 to i8*)], !type !0
+@vt2 = constant [1 x i8*] [i8* bitcast (i32 (i8*, i32)* @vf2 to i8*)], !type !0
 
 define i32 @vf1(i8* %this, i32 %arg) readnone {
   ret i32 %arg
index 93936d5e1d27aea1faab159627e763e74bf89037..7ac24777cf25184ba29a6b29a0f5f1eaa4da216c 100644 (file)
@@ -3,8 +3,8 @@
 target datalayout = "e-p:64:64"
 target triple = "x86_64-unknown-linux-gnu"
 
-@vt1 = global [1 x i8*] [i8* bitcast (i128 (i8*, i128)* @vf1 to i8*)], !type !0
-@vt2 = global [1 x i8*] [i8* bitcast (i128 (i8*, i128)* @vf2 to i8*)], !type !0
+@vt1 = constant [1 x i8*] [i8* bitcast (i128 (i8*, i128)* @vf1 to i8*)], !type !0
+@vt2 = constant [1 x i8*] [i8* bitcast (i128 (i8*, i128)* @vf2 to i8*)], !type !0
 
 define i128 @vf1(i8* %this, i128 %arg) readnone {
   ret i128 %arg
index 3124889a7070d7ab07d0a2f1439900a008490902..3f1930967f5a56df777a2184844dcaccf31215ef 100644 (file)
@@ -3,8 +3,8 @@
 target datalayout = "e-p:64:64"
 target triple = "x86_64-unknown-linux-gnu"
 
-@vt1 = global [1 x i8*] [i8* bitcast (i32 (i8*, i32)* @vf1 to i8*)], !type !0
-@vt2 = global [1 x i8*] [i8* bitcast (i32 (i8*, i32)* @vf2 to i8*)], !type !0
+@vt1 = constant [1 x i8*] [i8* bitcast (i32 (i8*, i32)* @vf1 to i8*)], !type !0
+@vt2 = constant [1 x i8*] [i8* bitcast (i32 (i8*, i32)* @vf2 to i8*)], !type !0
 
 define i32 @vf1(i8* %this, i32 %arg) readnone {
   ret i32 %arg
index fc4dee37dba7567ed57102393bfef14158a77ee3..542402e1657727d554b7810bebab3d6a2c2cd750 100644 (file)
@@ -3,8 +3,8 @@
 target datalayout = "e-p:64:64"
 target triple = "x86_64-unknown-linux-gnu"
 
-@vt1 = global [1 x i8*] [i8* bitcast (i32 (i8*)* @vf1 to i8*)], !type !0
-@vt2 = global [1 x i8*] [i8* bitcast (i32 (i8*)* @vf2 to i8*)], !type !0
+@vt1 = constant [1 x i8*] [i8* bitcast (i32 (i8*)* @vf1 to i8*)], !type !0
+@vt2 = constant [1 x i8*] [i8* bitcast (i32 (i8*)* @vf2 to i8*)], !type !0
 
 define i32 @vf1(i8* %this) readnone {
   %this_int = ptrtoint i8* %this to i32