[llvm] r294550 - LowerTypeTests: Change a few vtable globals in tests to constants.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 8 17:48:25 PST 2017


Author: pcc
Date: Wed Feb  8 19:48:24 2017
New Revision: 294550

URL: http://llvm.org/viewvc/llvm-project?rev=294550&view=rev
Log:
LowerTypeTests: Change a few vtable globals in tests to constants.

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.

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

Modified: llvm/trunk/test/Transforms/WholeProgramDevirt/bad-read-from-vtable.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/WholeProgramDevirt/bad-read-from-vtable.ll?rev=294550&r1=294549&r2=294550&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/WholeProgramDevirt/bad-read-from-vtable.ll (original)
+++ llvm/trunk/test/Transforms/WholeProgramDevirt/bad-read-from-vtable.ll Wed Feb  8 19:48:24 2017
@@ -3,8 +3,8 @@
 target datalayout = "e-p:64:64"
 target triple = "x86_64-unknown-linux-gnu"
 
- at vt1 = global [2 x i8*] [i8* zeroinitializer, i8* bitcast (void (i8*)* @vf to i8*)], !type !0
- at vt2 = global i8* bitcast (void (i8*)* @vf to i8*), !type !1
+ at vt1 = constant [2 x i8*] [i8* zeroinitializer, i8* bitcast (void (i8*)* @vf to i8*)], !type !0
+ at vt2 = constant i8* bitcast (void (i8*)* @vf to i8*), !type !1
 
 define void @vf(i8* %this) {
   ret void

Modified: llvm/trunk/test/Transforms/WholeProgramDevirt/vcp-accesses-memory.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/WholeProgramDevirt/vcp-accesses-memory.ll?rev=294550&r1=294549&r2=294550&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/WholeProgramDevirt/vcp-accesses-memory.ll (original)
+++ llvm/trunk/test/Transforms/WholeProgramDevirt/vcp-accesses-memory.ll Wed Feb  8 19:48:24 2017
@@ -3,8 +3,8 @@
 target datalayout = "e-p:64:64"
 target triple = "x86_64-unknown-linux-gnu"
 
- at vt1 = global [1 x i8*] [i8* bitcast (i32 (i8*, i32)* @vf1 to i8*)], !type !0
- at vt2 = global [1 x i8*] [i8* bitcast (i32 (i8*, i32)* @vf2 to i8*)], !type !0
+ at vt1 = constant [1 x i8*] [i8* bitcast (i32 (i8*, i32)* @vf1 to i8*)], !type !0
+ at 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

Modified: llvm/trunk/test/Transforms/WholeProgramDevirt/vcp-no-this.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/WholeProgramDevirt/vcp-no-this.ll?rev=294550&r1=294549&r2=294550&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/WholeProgramDevirt/vcp-no-this.ll (original)
+++ llvm/trunk/test/Transforms/WholeProgramDevirt/vcp-no-this.ll Wed Feb  8 19:48:24 2017
@@ -3,8 +3,8 @@
 target datalayout = "e-p:64:64"
 target triple = "x86_64-unknown-linux-gnu"
 
- at vt1 = global [1 x i8*] [i8* bitcast (i32 ()* @vf1 to i8*)], !type !0
- at vt2 = global [1 x i8*] [i8* bitcast (i32 ()* @vf2 to i8*)], !type !0
+ at vt1 = constant [1 x i8*] [i8* bitcast (i32 ()* @vf1 to i8*)], !type !0
+ at vt2 = constant [1 x i8*] [i8* bitcast (i32 ()* @vf2 to i8*)], !type !0
 
 define i32 @vf1() readnone {
   ret i32 1

Modified: llvm/trunk/test/Transforms/WholeProgramDevirt/vcp-non-constant-arg.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/WholeProgramDevirt/vcp-non-constant-arg.ll?rev=294550&r1=294549&r2=294550&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/WholeProgramDevirt/vcp-non-constant-arg.ll (original)
+++ llvm/trunk/test/Transforms/WholeProgramDevirt/vcp-non-constant-arg.ll Wed Feb  8 19:48:24 2017
@@ -3,8 +3,8 @@
 target datalayout = "e-p:64:64"
 target triple = "x86_64-unknown-linux-gnu"
 
- at vt1 = global [1 x i8*] [i8* bitcast (i32 (i8*, i32)* @vf1 to i8*)], !type !0
- at vt2 = global [1 x i8*] [i8* bitcast (i32 (i8*, i32)* @vf2 to i8*)], !type !0
+ at vt1 = constant [1 x i8*] [i8* bitcast (i32 (i8*, i32)* @vf1 to i8*)], !type !0
+ at 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

Modified: llvm/trunk/test/Transforms/WholeProgramDevirt/vcp-too-wide-ints.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/WholeProgramDevirt/vcp-too-wide-ints.ll?rev=294550&r1=294549&r2=294550&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/WholeProgramDevirt/vcp-too-wide-ints.ll (original)
+++ llvm/trunk/test/Transforms/WholeProgramDevirt/vcp-too-wide-ints.ll Wed Feb  8 19:48:24 2017
@@ -3,8 +3,8 @@
 target datalayout = "e-p:64:64"
 target triple = "x86_64-unknown-linux-gnu"
 
- at vt1 = global [1 x i8*] [i8* bitcast (i128 (i8*, i128)* @vf1 to i8*)], !type !0
- at vt2 = global [1 x i8*] [i8* bitcast (i128 (i8*, i128)* @vf2 to i8*)], !type !0
+ at vt1 = constant [1 x i8*] [i8* bitcast (i128 (i8*, i128)* @vf1 to i8*)], !type !0
+ at 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

Modified: llvm/trunk/test/Transforms/WholeProgramDevirt/vcp-type-mismatch.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/WholeProgramDevirt/vcp-type-mismatch.ll?rev=294550&r1=294549&r2=294550&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/WholeProgramDevirt/vcp-type-mismatch.ll (original)
+++ llvm/trunk/test/Transforms/WholeProgramDevirt/vcp-type-mismatch.ll Wed Feb  8 19:48:24 2017
@@ -3,8 +3,8 @@
 target datalayout = "e-p:64:64"
 target triple = "x86_64-unknown-linux-gnu"
 
- at vt1 = global [1 x i8*] [i8* bitcast (i32 (i8*, i32)* @vf1 to i8*)], !type !0
- at vt2 = global [1 x i8*] [i8* bitcast (i32 (i8*, i32)* @vf2 to i8*)], !type !0
+ at vt1 = constant [1 x i8*] [i8* bitcast (i32 (i8*, i32)* @vf1 to i8*)], !type !0
+ at 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

Modified: llvm/trunk/test/Transforms/WholeProgramDevirt/vcp-uses-this.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/WholeProgramDevirt/vcp-uses-this.ll?rev=294550&r1=294549&r2=294550&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/WholeProgramDevirt/vcp-uses-this.ll (original)
+++ llvm/trunk/test/Transforms/WholeProgramDevirt/vcp-uses-this.ll Wed Feb  8 19:48:24 2017
@@ -3,8 +3,8 @@
 target datalayout = "e-p:64:64"
 target triple = "x86_64-unknown-linux-gnu"
 
- at vt1 = global [1 x i8*] [i8* bitcast (i32 (i8*)* @vf1 to i8*)], !type !0
- at vt2 = global [1 x i8*] [i8* bitcast (i32 (i8*)* @vf2 to i8*)], !type !0
+ at vt1 = constant [1 x i8*] [i8* bitcast (i32 (i8*)* @vf1 to i8*)], !type !0
+ at 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




More information about the llvm-commits mailing list