alias-recursion.ll 799 B

123456789101112131415161718192021222324
  1. ; RUN: opt < %s -instcombine -S | FileCheck %s
  2. target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
  3. target triple = "x86_64-pc-windows-msvc"
  4. %class.A = type { i32 (...)** }
  5. @0 = constant [1 x i8*] zeroinitializer
  6. @vtbl = alias getelementptr inbounds ([1 x i8*], [1 x i8*]* @0, i32 0, i32 0)
  7. define i32 (%class.A*)* @test() {
  8. ; CHECK-LABEL: test
  9. entry:
  10. br i1 undef, label %for.body, label %for.end
  11. for.body: ; preds = %for.body, %entry
  12. br i1 undef, label %for.body, label %for.end
  13. for.end: ; preds = %for.body, %entry
  14. %A = phi i32 (%class.A*)** [ bitcast (i8** @vtbl to i32 (%class.A*)**), %for.body ], [ null, %entry ]
  15. %B = load i32 (%class.A*)*, i32 (%class.A*)** %A
  16. ret i32 (%class.A*)* %B
  17. }