[llvm] [NFC][WPD] Add constant propagation tests checking relative vtables (PR #138989)

Paul Kirth via llvm-commits llvm-commits at lists.llvm.org
Wed May 7 18:02:05 PDT 2025


================
@@ -1,34 +1,35 @@
 ; RUN: opt -S -passes=wholeprogramdevirt -whole-program-visibility %s | FileCheck %s
 
 target datalayout = "e-p:64:64"
-target triple = "x86_64-unknown-linux-gnu"
 
-; CHECK: [[VT1DATA:@[^ ]*]] = private constant { [8 x i8], [3 x ptr], [0 x i8] } { [8 x i8] c"\00\00\00\01\00\00\00\02", [3 x ptr] [ptr @vf0i1, ptr @vf1i1, ptr @vf1i32], [0 x i8] zeroinitializer }, section "vt1sec", !type [[T8:![0-9]+]]
+;; Note that i16 is used here such that we can ensure all constants for "typeid"
+;; can come before the vtable.
----------------
ilovepi wrote:

Does that imply that you also need tests where that condition is false? so, where all constants for typeid can't be before the vtable?

https://github.com/llvm/llvm-project/pull/138989


More information about the llvm-commits mailing list