diff options
Diffstat (limited to 'test/CodeGenCXX')
| -rw-r--r-- | test/CodeGenCXX/attr.cpp | 3 | ||||
| -rw-r--r-- | test/CodeGenCXX/condition.cpp | 28 | ||||
| -rw-r--r-- | test/CodeGenCXX/constructor-template.cpp | 4 | ||||
| -rw-r--r-- | test/CodeGenCXX/copy-assign-synthesis-3.cpp | 2 | ||||
| -rw-r--r-- | test/CodeGenCXX/default-constructor-default-argument.cpp | 2 | ||||
| -rw-r--r-- | test/CodeGenCXX/default-destructor-synthesis.cpp | 9 | ||||
| -rw-r--r-- | test/CodeGenCXX/deferred-global-init.cpp | 16 | ||||
| -rw-r--r-- | test/CodeGenCXX/delete-two-arg.cpp | 2 | ||||
| -rw-r--r-- | test/CodeGenCXX/dyncast.cpp | 703 | ||||
| -rw-r--r-- | test/CodeGenCXX/eh.cpp | 46 | ||||
| -rw-r--r-- | test/CodeGenCXX/expr.cpp | 4 | ||||
| -rw-r--r-- | test/CodeGenCXX/mangle.cpp | 7 | ||||
| -rw-r--r-- | test/CodeGenCXX/member-function-pointers.cpp | 11 | ||||
| -rw-r--r-- | test/CodeGenCXX/reference-init.cpp | 7 | ||||
| -rw-r--r-- | test/CodeGenCXX/virt.cpp | 86 | ||||
| -rw-r--r-- | test/CodeGenCXX/virtual-destructor-calls.cpp | 8 | ||||
| -rw-r--r-- | test/CodeGenCXX/vtable-key-function.cpp | 18 | ||||
| -rw-r--r-- | test/CodeGenCXX/vtable-linkage.cpp | 95 |
18 files changed, 602 insertions, 449 deletions
diff --git a/test/CodeGenCXX/attr.cpp b/test/CodeGenCXX/attr.cpp index 8fd86414862c..1b214b77bee7 100644 --- a/test/CodeGenCXX/attr.cpp +++ b/test/CodeGenCXX/attr.cpp @@ -15,6 +15,9 @@ class C { virtual void bar3() __attribute__((aligned(1024))); } c; +// CHECK:.align 1, 0x90 +// CHECK-NEXT:.globl __ZN1CC1Ev + void C::bar1() { } // CHECK:.align 1, 0x90 diff --git a/test/CodeGenCXX/condition.cpp b/test/CodeGenCXX/condition.cpp index eca07d866bfc..a1b7a09aa347 100644 --- a/test/CodeGenCXX/condition.cpp +++ b/test/CodeGenCXX/condition.cpp @@ -39,10 +39,10 @@ void if_destruct(int z) { // CHECK: call void @_ZN1XC1Ev if (X x = X()) Y y; - // CHECK: if.then + // CHECK: br // CHECK: call void @_ZN1YC1Ev // CHECK: call void @_ZN1YD1Ev - // CHECK: if.end + // CHECK: br // CHECK: call void @_ZN1XD1Ev } @@ -59,12 +59,12 @@ void switch_destruct(int z) { break; default: - // CHECK: sw.default: + // CHECK: {{sw.default:|:3}} // CHECK: store i32 19 z = 19; break; } - // CHECK: sw.epilog: + // CHECK: {{sw.epilog:|:4}} // CHECK: call void @_ZN16ConvertibleToIntD1Ev // CHECK: store i32 20 z = 20; @@ -74,18 +74,18 @@ int foo(); void while_destruct(int z) { // CHECK: define void @_Z14while_destructi - // CHECK: while.cond: + // CHECK: {{while.cond:|:1}} while (X x = X()) { // CHECK: call void @_ZN1XC1Ev - // CHECK: while.body: + // CHECK: {{while.body:|:3}} // CHECK: store i32 21 z = 21; - // CHECK: while.cleanup: + // CHECK: {{while.cleanup:|:4}} // CHECK: call void @_ZN1XD1Ev } - // CHECK: while.end + // CHECK: {{while.end|:6}} // CHECK: store i32 22 z = 22; } @@ -94,16 +94,16 @@ void for_destruct(int z) { // CHECK: define void @_Z12for_destruct // CHECK: call void @_ZN1YC1Ev for(Y y = Y(); X x = X(); ++z) - // CHECK: for.cond: + // CHECK: {{for.cond:|:1}} // CHECK: call void @_ZN1XC1Ev - // CHECK: for.body: + // CHECK: {{for.body:|:3}} // CHECK: store i32 23 z = 23; - // CHECK: for.inc: - // CHECK: br label %for.cond.cleanup - // CHECK: for.cond.cleanup: + // CHECK: {{for.inc:|:4}} + // CHECK: br label %{{for.cond.cleanup|7}} + // CHECK: {{for.cond.cleanup:|:7}} // CHECK: call void @_ZN1XD1Ev - // CHECK: for.end: + // CHECK: {{for.end:|:9}} // CHECK: call void @_ZN1YD1Ev // CHECK: store i32 24 z = 24; diff --git a/test/CodeGenCXX/constructor-template.cpp b/test/CodeGenCXX/constructor-template.cpp index a3576fdc72fe..a3f38a6984ac 100644 --- a/test/CodeGenCXX/constructor-template.cpp +++ b/test/CodeGenCXX/constructor-template.cpp @@ -44,10 +44,10 @@ int main() { delete node; } -// CHECK-LP64: __ZN4NodeIP12BinomialNodeIiEEC1Ev: +// CHECK-LP64: __ZN4NodeIP12BinomialNodeIiEEC2Ev: // CHECK-LP64: __ZN4ListIP12BinomialNodeIiEEC1Ev: // CHECK-LP64: __ZN4ListIP12BinomialNodeIiEED1Ev: -// CHECK-LP32: __ZN4NodeIP12BinomialNodeIiEEC1Ev: +// CHECK-LP32: __ZN4NodeIP12BinomialNodeIiEEC2Ev: // CHECK-LP32: __ZN4ListIP12BinomialNodeIiEEC1Ev: // CHECK-LP32: __ZN4ListIP12BinomialNodeIiEED1Ev: diff --git a/test/CodeGenCXX/copy-assign-synthesis-3.cpp b/test/CodeGenCXX/copy-assign-synthesis-3.cpp index 0c876d02ec56..73c2261cddc1 100644 --- a/test/CodeGenCXX/copy-assign-synthesis-3.cpp +++ b/test/CodeGenCXX/copy-assign-synthesis-3.cpp @@ -9,6 +9,8 @@ struct B { float b; int (A::*c)(); _Complex float d; + int e[10]; + A f[2]; }; void a(B& x, B& y) { x = y; diff --git a/test/CodeGenCXX/default-constructor-default-argument.cpp b/test/CodeGenCXX/default-constructor-default-argument.cpp index 971757d241b4..f2c7f6d12a34 100644 --- a/test/CodeGenCXX/default-constructor-default-argument.cpp +++ b/test/CodeGenCXX/default-constructor-default-argument.cpp @@ -5,4 +5,4 @@ struct A { A(int x = 2); }; struct B : public A {}; B x; -// CHECK: call void @_ZN1AC1Ei +// CHECK: call void @_ZN1AC2Ei diff --git a/test/CodeGenCXX/default-destructor-synthesis.cpp b/test/CodeGenCXX/default-destructor-synthesis.cpp index 098458d35d5c..71167a204fbb 100644 --- a/test/CodeGenCXX/default-destructor-synthesis.cpp +++ b/test/CodeGenCXX/default-destructor-synthesis.cpp @@ -45,15 +45,14 @@ M gm; int main() {M m1;} -// CHECK-LP64: callq __ZN1MC1Ev -// CHECK-LP64: callq __ZN1MD1Ev // CHECK-LP64: .globl __ZN1MD1Ev // CHECK-LP64-NEXT: .weak_definition __ZN1MD1Ev // CHECK-LP64-NEXT: __ZN1MD1Ev: +// CHECK-LP64: callq __ZN1MC1Ev +// CHECK-LP64: callq __ZN1MD1Ev - -// CHECK-LP32: call L__ZN1MC1Ev -// CHECK-LP32: call L__ZN1MD1Ev // CHECK-LP32: .globl __ZN1MD1Ev // CHECK-LP32-NEXT: .weak_definition __ZN1MD1Ev // CHECK-LP32-NEXT:__ZN1MD1Ev: +// CHECK-LP32: call L__ZN1MC1Ev +// CHECK-LP32: call L__ZN1MD1Ev diff --git a/test/CodeGenCXX/deferred-global-init.cpp b/test/CodeGenCXX/deferred-global-init.cpp new file mode 100644 index 000000000000..570147905548 --- /dev/null +++ b/test/CodeGenCXX/deferred-global-init.cpp @@ -0,0 +1,16 @@ +// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s +// PR5967 + +extern void* foo; +static void* const a = foo; +void* bar() { return a; } + +// CHECK: @a = internal global i8* null + +// CHECK: define internal void @__cxx_global_var_init +// CHECK: load i8** @foo +// CHECK: ret void + +// CHECK: define internal void @__cxx_global_initialization +// CHECK: call void @__cxx_global_var_init() +// CHECK: ret void diff --git a/test/CodeGenCXX/delete-two-arg.cpp b/test/CodeGenCXX/delete-two-arg.cpp index d6bdb098844f..5358747fed7b 100644 --- a/test/CodeGenCXX/delete-two-arg.cpp +++ b/test/CodeGenCXX/delete-two-arg.cpp @@ -3,4 +3,4 @@ struct A { void operator delete(void*,__typeof(sizeof(int))); int x; }; void a(A* x) { delete x; } -// CHECK: call void @_ZN1AdlEPvj(i8* %0, i32 4) +// CHECK: call void @_ZN1AdlEPvj(i8* %{{.*}}, i32 4) diff --git a/test/CodeGenCXX/dyncast.cpp b/test/CodeGenCXX/dyncast.cpp index a2d116a89872..054b972bb158 100644 --- a/test/CodeGenCXX/dyncast.cpp +++ b/test/CodeGenCXX/dyncast.cpp @@ -59,356 +59,355 @@ void test1() { } // CHECK-LL: define void @_Z5test1v() nounwind { -// CHECK-LL-NEXT:entry: -// CHECK-LL-NEXT: %bp = alloca %class.test1_A*, align 8 -// CHECK-LL-NEXT: %ap = alloca %class.test1_A*, align 8 -// CHECK-LL-NEXT: %dp = alloca %class.test1_D*, align 8 -// CHECK-LL-NEXT: %ap37 = alloca %class.test1_A*, align 8 -// CHECK-LL-NEXT: %dp53 = alloca %class.test1_D*, align 8 -// CHECK-LL-NEXT: %ep1 = alloca %class.test1_E*, align 8 -// CHECK-LL-NEXT: %cdp = alloca %class.test1_D*, align 8 -// CHECK-LL-NEXT: %ep = alloca %class.test1_E*, align 8 -// CHECK-LL-NEXT: %vp = alloca i8*, align 8 -// CHECK-LL-NEXT: %cvp = alloca i8*, align 8 -// CHECK-LL-NEXT: br i1 false, label %cast.null, label %cast.notnull -// CHECK-LL: cast.notnull: -// CHECK-LL-NEXT: br label %cast.end -// CHECK-LL: cast.null: -// CHECK-LL-NEXT: br label %cast.end -// CHECK-LL: cast.end: -// CHECK-LL-NEXT: %0 = phi %class.test1_A* [ bitcast (%class.test1_D* @test1_d to %class.test1_A*), %cast.notnull ], [ null, %cast.null ] -// CHECK-LL-NEXT: store %class.test1_A* %0, %class.test1_A** %bp -// CHECK-LL-NEXT: br i1 false, label %cast.null2, label %cast.notnull1 -// CHECK-LL: cast.notnull1: -// CHECK-LL-NEXT: %vtable = load i8** bitcast (%class.test1_D* @test1_d to i8**) -// CHECK-LL-NEXT: %vbase.offset.ptr = getelementptr i8* %vtable, i64 -24 -// CHECK-LL-NEXT: %1 = bitcast i8* %vbase.offset.ptr to i64* -// CHECK-LL-NEXT: %vbase.offset = load i64* %1 -// CHECK-LL-NEXT: %add.ptr = getelementptr i8* getelementptr inbounds (%class.test1_D* @test1_d, i32 0, i32 0, i32 0), i64 %vbase.offset -// CHECK-LL-NEXT: %2 = bitcast i8* %add.ptr to %class.test1_A* -// CHECK-LL-NEXT: br label %cast.end3 -// CHECK-LL: cast.null2: -// CHECK-LL-NEXT: br label %cast.end3 -// CHECK-LL: cast.end3: -// CHECK-LL-NEXT: %3 = phi %class.test1_A* [ %2, %cast.notnull1 ], [ null, %cast.null2 ] -// CHECK-LL-NEXT: store %class.test1_A* %3, %class.test1_A** %ap -// CHECK-LL-NEXT: %tmp = load %class.test1_A** %bp -// CHECK-LL-NEXT: %4 = icmp ne %class.test1_A* %tmp, null -// CHECK-LL-NEXT: br i1 %4, label %5, label %9 -// CHECK-LL: ; <label>:5 -// CHECK-LL-NEXT: %6 = bitcast %class.test1_A* %tmp to i8* -// CHECK-LL-NEXT: %7 = call i8* @__dynamic_cast(i8* %6, i8* bitcast (%0* @_ZTI7test1_B to i8*), i8* bitcast (%1* @_ZTI7test1_D to i8*), i64 -1) ; <i8*> [#uses=1] -// CHECK-LL-NEXT: %8 = bitcast i8* %7 to %class.test1_D* -// CHECK-LL-NEXT: br label %10 -// CHECK-LL: ; <label>:9 -// CHECK-LL-NEXT: br label %10 -// CHECK-LL: ; <label>:10 -// CHECK-LL-NEXT: %11 = phi %class.test1_D* [ %8, %5 ], [ null, %9 ] -// CHECK-LL-NEXT: store %class.test1_D* %11, %class.test1_D** %dp -// CHECK-LL-NEXT: %tmp4 = load %class.test1_D** %dp -// CHECK-LL-NEXT: %cmp = icmp eq %class.test1_D* %tmp4, null -// CHECK-LL-NEXT: br i1 %cmp, label %if.then, label %if.else -// CHECK-LL: if.then: -// CHECK-LL-NEXT: %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i32 0, i32 0), i32 1) -// CHECK-LL-NEXT: br label %if.end -// CHECK-LL: if.else: -// CHECK-LL-NEXT: %call5 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str1, i32 0, i32 0), i32 1) -// CHECK-LL-NEXT: br label %if.end -// CHECK-LL: if.end: -// CHECK-LL-NEXT: %tmp6 = load %class.test1_A** %bp -// CHECK-LL-NEXT: %12 = icmp ne %class.test1_A* %tmp6, null -// CHECK-LL-NEXT: br i1 %12, label %13, label %17 -// CHECK-LL: ; <label>:13 -// CHECK-LL-NEXT: %14 = bitcast %class.test1_A* %tmp6 to i8* -// CHECK-LL-NEXT: %15 = call i8* @__dynamic_cast(i8* %14, i8* bitcast ({{.*}} @_ZTI7test1_B to i8*), i8* bitcast ({{.*}} @_ZTI7test1_A to i8*), i64 -1) -// CHECK-LL-NEXT: %16 = bitcast i8* %15 to %class.test1_A* -// CHECK-LL-NEXT: br label %18 -// CHECK-LL: ; <label>:17 -// CHECK-LL-NEXT: br label %18 -// CHECK-LL: ; <label>:18 -// CHECK-LL-NEXT: %19 = phi %class.test1_A* [ %16, %13 ], [ null, %17 ] -// CHECK-LL-NEXT: store %class.test1_A* %19, %class.test1_A** %ap -// CHECK-LL-NEXT: %tmp7 = load %class.test1_A** %ap -// CHECK-LL-NEXT: %cmp8 = icmp eq %class.test1_A* %tmp7, null -// CHECK-LL-NEXT: br i1 %cmp8, label %if.then9, label %if.else11 -// CHECK-LL: if.then9: -// CHECK-LL-NEXT: %call10 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i32 0, i32 0), i32 2) -// CHECK-LL-NEXT: br label %if.end13 -// CHECK-LL: if.else11: -// CHECK-LL-NEXT: %call12 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str1, i32 0, i32 0), i32 2) -// CHECK-LL-NEXT: br label %if.end13 -// CHECK-LL: if.end13: -// CHECK-LL-NEXT: %tmp14 = load %class.test1_A** %ap -// CHECK-LL-NEXT: %20 = icmp ne %class.test1_A* %tmp14, null -// CHECK-LL-NEXT: br i1 %20, label %21, label %25 -// CHECK-LL: ; <label>:21 -// CHECK-LL-NEXT: %22 = bitcast %class.test1_A* %tmp14 to i8* -// CHECK-LL-NEXT: %23 = call i8* @__dynamic_cast({{.*}} %22, i8* bitcast ({{.*}} @_ZTI7test1_A to i8*), i8* bitcast ({{.*}} @_ZTI7test1_B to i8*), i64 -1) -// CHECK-LL-NEXT: %24 = bitcast i8* %23 to %class.test1_A* -// CHECK-LL-NEXT: br label %26 -// CHECK-LL: ; <label>:25 -// CHECK-LL-NEXT: br label %26 -// CHECK-LL: ; <label>:26 -// CHECK-LL-NEXT: %27 = phi %class.test1_A* [ %24, %21 ], [ null, %25 ] -// CHECK-LL-NEXT: store %class.test1_A* %27, %class.test1_A** %bp -// CHECK-LL-NEXT: %tmp15 = load %class.test1_A** %bp -// CHECK-LL-NEXT: %cmp16 = icmp eq %class.test1_A* %tmp15, null -// CHECK-LL-NEXT: br i1 %cmp16, label %if.then17, label %if.else19 -// CHECK-LL: if.then17: -// CHECK-LL-NEXT: %call18 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i32 0, i32 0), i32 3) -// CHECK-LL-NEXT: br label %if.end21 -// CHECK-LL: if.else19: -// CHECK-LL-NEXT: %call20 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str1, i32 0, i32 0), i32 3) -// CHECK-LL-NEXT: br label %if.end21 -// CHECK-LL: if.end21: -// CHECK-LL-NEXT: br i1 false, label %cast.null27, label %cast.notnull22 -// CHECK-LL: cast.notnull22: -// CHECK-LL-NEXT: %vtable23 = load i8** bitcast (%class.test1_D* @test1_d to i8**) -// CHECK-LL-NEXT: %vbase.offset.ptr24 = getelementptr i8* %vtable23, i64 -24 -// CHECK-LL-NEXT: %28 = bitcast i8* %vbase.offset.ptr24 to i64* -// CHECK-LL-NEXT: %vbase.offset25 = load i64* %28 -// CHECK-LL-NEXT: %add.ptr26 = getelementptr i8* getelementptr inbounds (%class.test1_D* @test1_d, i32 0, i32 0, i32 0), i64 %vbase.offset25 -// CHECK-LL-NEXT: %29 = bitcast i8* %add.ptr26 to %class.test1_A* -// CHECK-LL-NEXT: br label %cast.end28 -// CHECK-LL: cast.null27: -// CHECK-LL-NEXT: br label %cast.end28 -// CHECK-LL: cast.end28: -// CHECK-LL-NEXT: %30 = phi %class.test1_A* [ %29, %cast.notnull22 ], [ null, %cast.null27 ] -// CHECK-LL-NEXT: store %class.test1_A* %30, %class.test1_A** %ap -// CHECK-LL-NEXT: %tmp29 = load %class.test1_A** %ap -// CHECK-LL-NEXT: %cmp30 = icmp ne %class.test1_A* %tmp29, null -// CHECK-LL-NEXT: br i1 %cmp30, label %if.then31, label %if.else33 -// CHECK-LL: if.then31: -// CHECK-LL-NEXT: %call32 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i32 0, i32 0), i32 4) -// CHECK-LL-NEXT: br label %if.end35 -// CHECK-LL: if.else33: -// CHECK-LL-NEXT: %call34 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str1, i32 0, i32 0), i32 4) -// CHECK-LL-NEXT: br label %if.end35 -// CHECK-LL: if.end35: -// CHECK-LL-NEXT: br i1 false, label %cast.null43, label %cast.notnull38 -// CHECK-LL: cast.notnull38: -// CHECK-LL-NEXT: %vtable39 = load i8** bitcast (%class.test1_F* @test1_f to i8**) -// CHECK-LL-NEXT: %vbase.offset.ptr40 = getelementptr i8* %vtable39, i64 -24 -// CHECK-LL-NEXT: %31 = bitcast i8* %vbase.offset.ptr40 to i64* -// CHECK-LL-NEXT: %vbase.offset41 = load i64* %31 -// CHECK-LL-NEXT: %add.ptr42 = getelementptr i8* getelementptr inbounds (%class.test1_F* @test1_f, i32 0, i32 0, i32 0), i64 %vbase.offset41 -// CHECK-LL-NEXT: %32 = bitcast i8* %add.ptr42 to %class.test1_A* -// CHECK-LL-NEXT: br label %cast.end44 -// CHECK-LL: cast.null43: -// CHECK-LL-NEXT: br label %cast.end44 -// CHECK-LL: cast.end44: -// CHECK-LL-NEXT: %33 = phi %class.test1_A* [ %32, %cast.notnull38 ], [ null, %cast.null43 ] -// CHECK-LL-NEXT: store %class.test1_A* %33, %class.test1_A** %ap37 -// CHECK-LL-NEXT: %tmp45 = load %class.test1_A** %ap37 -// CHECK-LL-NEXT: %cmp46 = icmp ne %class.test1_A* %tmp45, null -// CHECK-LL-NEXT: br i1 %cmp46, label %if.then47, label %if.else49 -// CHECK-LL: if.then47: -// CHECK-LL-NEXT: %call48 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i32 0, i32 0), i32 6) -// CHECK-LL-NEXT: br label %if.end51 -// CHECK-LL: if.else49: -// CHECK-LL-NEXT: %call50 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str1, i32 0, i32 0), i32 6) -// CHECK-LL-NEXT: br label %if.end51 -// CHECK-LL: if.end51: -// CHECK-LL-NEXT: %tmp54 = load %class.test1_A** %ap37 -// CHECK-LL-NEXT: %34 = icmp ne %class.test1_A* %tmp54, null -// CHECK-LL-NEXT: br i1 %34, label %35, label %39 -// CHECK-LL: ; <label>:35 -// CHECK-LL-NEXT: %36 = bitcast %class.test1_A* %tmp54 to i8* -// CHECK-LL-NEXT: %37 = call i8* @__dynamic_cast(i8* %36, i8* bitcast ({{.*}} @_ZTI7test1_A to i8*), i8* bitcast ({{.*}} @_ZTI7test1_D to i8*), i64 -1) -// CHECK-LL-NEXT: %38 = bitcast i8* %37 to %class.test1_D* -// CHECK-LL-NEXT: br label %40 -// CHECK-LL: ; <label>:39 -// CHECK-LL-NEXT: br label %40 -// CHECK-LL: ; <label>:40 -// CHECK-LL-NEXT: %41 = phi %class.test1_D* [ %38, %35 ], [ null, %39 ] -// CHECK-LL-NEXT: store %class.test1_D* %41, %class.test1_D** %dp53 -// CHECK-LL-NEXT: %tmp55 = load %class.test1_D** %dp53 -// CHECK-LL-NEXT: %cmp56 = icmp eq %class.test1_D* %tmp55, null -// CHECK-LL-NEXT: br i1 %cmp56, label %if.then57, label %if.else59 -// CHECK-LL: if.then57: -// CHECK-LL-NEXT: %call58 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i32 0, i32 0), i32 7) -// CHECK-LL-NEXT: br label %if.end61 -// CHECK-LL: if.else59: -// CHECK-LL-NEXT: %call60 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str1, i32 0, i32 0), i32 7) -// CHECK-LL-NEXT: br label %if.end61 -// CHECK-LL: if.end61: -// CHECK-LL-NEXT: %tmp63 = load %class.test1_A** %ap37 -// CHECK-LL-NEXT: %42 = icmp ne %class.test1_A* %tmp63, null -// CHECK-LL-NEXT: br i1 %42, label %43, label %47 -// CHECK-LL: ; <label>:43 -// CHECK-LL-NEXT: %44 = bitcast %class.test1_A* %tmp63 to i8* -// CHECK-LL-NEXT: %45 = call i8* @__dynamic_cast(i8* %44, i8* bitcast ({{.*}} @_ZTI7test1_A to i8*), i8* bitcast ({{.*}} @_ZTI7test1_E to i8*), i64 -1) -// CHECK-LL-NEXT: %46 = bitcast i8* %45 to %class.test1_E* -// CHECK-LL-NEXT: br label %48 -// CHECK-LL: ; <label>:47 -// CHECK-LL-NEXT: br label %48 -// CHECK-LL: ; <label>:48 -// CHECK-LL-NEXT: %49 = phi %class.test1_E* [ %46, %43 ], [ null, %47 ] -// CHECK-LL-NEXT: store %class.test1_E* %49, %class.test1_E** %ep1 -// CHECK-LL-NEXT: %tmp64 = load %class.test1_E** %ep1 -// CHECK-LL-NEXT: %cmp65 = icmp ne %class.test1_E* %tmp64, null -// CHECK-LL-NEXT: br i1 %cmp65, label %if.then66, label %if.else68 -// CHECK-LL: if.then66: -// CHECK-LL-NEXT: %call67 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i32 0, i32 0), i32 8) -// CHECK-LL-NEXT: br label %if.end70 -// CHECK-LL: if.else68: -// CHECK-LL-NEXT: %call69 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str1, i32 0, i32 0), i32 8) -// CHECK-LL-NEXT: br label %if.end70 -// CHECK-LL: if.end70: -// CHECK-LL-NEXT: store %class.test1_D* @test1_d, %class.test1_D** %dp -// CHECK-LL-NEXT: %tmp71 = load %class.test1_D** %dp -// CHECK-LL-NEXT: %cmp72 = icmp eq %class.test1_D* %tmp71, @test1_d -// CHECK-LL-NEXT: br i1 %cmp72, label %if.then73, label %if.else75 -// CHECK-LL: if.then73: -// CHECK-LL-NEXT: %call74 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i32 0, i32 0), i32 9) -// CHECK-LL-NEXT: br label %if.end77 -// CHECK-LL: if.else75: -// CHECK-LL-NEXT: %call76 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str1, i32 0, i32 0), i32 9) -// CHECK-LL-NEXT: br label %if.end77 -// CHECK-LL: if.end77: -// CHECK-LL-NEXT: store %class.test1_D* @test1_d, %class.test1_D** %cdp -// CHECK-LL-NEXT: %tmp79 = load %class.test1_D** %cdp -// CHECK-LL-NEXT: %cmp80 = icmp eq %class.test1_D* %tmp79, @test1_d -// CHECK-LL-NEXT: br i1 %cmp80, label %if.then81, label %if.else83 -// CHECK-LL: if.then81: -// CHECK-LL-NEXT: %call82 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i32 0, i32 0), i32 10) -// CHECK-LL-NEXT: br label %if.end85 -// CHECK-LL: if.else83: -// CHECK-LL-NEXT: %call84 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str1, i32 0, i32 0), i32 10) -// CHECK-LL-NEXT: br label %if.end85 -// CHECK-LL: if.end85: -// CHECK-LL-NEXT: br i1 false, label %50, label %53 -// CHECK-LL: ; <label>:50 -// CHECK-LL-NEXT: %51 = call i8* @__dynamic_cast(i8* null, i8* bitcast ({{.*}}* @_ZTI7test1_A to i8*), i8* bitcast ({{.*}} @_ZTI7test1_D to i8*), i64 -1) -// CHECK-LL-NEXT: %52 = bitcast i8* %51 to %class.test1_D* -// CHECK-LL-NEXT: br label %54 -// CHECK-LL: ; <label>:53 -// CHECK-LL-NEXT: br label %54 -// CHECK-LL: ; <label>:54 -// CHECK-LL-NEXT: %55 = phi %class.test1_D* [ %52, %50 ], [ null, %53 ] -// CHECK-LL-NEXT: store %class.test1_D* %55, %class.test1_D** %dp -// CHECK-LL-NEXT: %tmp86 = load %class.test1_D** %dp -// CHECK-LL-NEXT: %cmp87 = icmp eq %class.test1_D* %tmp86, null -// CHECK-LL-NEXT: br i1 %cmp87, label %if.then88, label %if.else90 -// CHECK-LL: if.then88: -// CHECK-LL-NEXT: %call89 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i32 0, i32 0), i32 11) -// CHECK-LL-NEXT: br label %if.end92 -// CHECK-LL: if.else90: -// CHECK-LL-NEXT: %call91 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str1, i32 0, i32 0), i32 11) -// CHECK-LL-NEXT: br label %if.end92 -// CHECK-LL: if.end92: -// CHECK-LL-NEXT: br i1 false, label %cast.null98, label %cast.notnull93 -// CHECK-LL: cast.notnull93: -// CHECK-LL-NEXT: %vtable94 = load i8** bitcast (%class.test1_D* @test1_d to i8**) -// CHECK-LL-NEXT: %vbase.offset.ptr95 = getelementptr i8* %vtable94, i64 -24 -// CHECK-LL-NEXT: %56 = bitcast i8* %vbase.offset.ptr95 to i64* -// CHECK-LL-NEXT: %vbase.offset96 = load i64* %56 -// CHECK-LL-NEXT: %add.ptr97 = getelementptr i8* getelementptr inbounds (%class.test1_D* @test1_d, i32 0, i32 0, i32 0), i64 %vbase.offset96 -// CHECK-LL-NEXT: %57 = bitcast i8* %add.ptr97 to %class.test1_A* -// CHECK-LL-NEXT: br label %cast.end99 -// CHECK-LL: cast.null98: -// CHECK-LL-NEXT: br label %cast.end99 -// CHECK-LL: cast.end99: -// CHECK-LL-NEXT: %58 = phi %class.test1_A* [ %57, %cast.notnull93 ], [ null, %cast.null98 ] -// CHECK-LL-NEXT: store %class.test1_A* %58, %class.test1_A** %ap -// CHECK-LL-NEXT: %tmp100 = load %class.test1_A** %ap -// CHECK-LL-NEXT: br i1 false, label %cast.null106, label %cast.notnull101 -// CHECK-LL: cast.notnull101: -// CHECK-LL-NEXT: %vtable102 = load i8** bitcast (%class.test1_D* @test1_d to i8**) -// CHECK-LL-NEXT: %vbase.offset.ptr103 = getelementptr i8* %vtable102, i64 -24 -// CHECK-LL-NEXT: %59 = bitcast i8* %vbase.offset.ptr103 to i64* -// CHECK-LL-NEXT: %vbase.offset104 = load i64* %59 -// CHECK-LL-NEXT: %add.ptr105 = getelementptr i8* getelementptr inbounds (%class.test1_D* @test1_d, i32 0, i32 0, i32 0), i64 %vbase.offset104 -// CHECK-LL-NEXT: %60 = bitcast i8* %add.ptr105 to %class.test1_A* -// CHECK-LL-NEXT: br label %cast.end107 -// CHECK-LL: cast.null106: -// CHECK-LL-NEXT: br label %cast.end107 -// CHECK-LL: cast.end107: -// CHECK-LL-NEXT: %61 = phi %class.test1_A* [ %60, %cast.notnull101 ], [ null, %cast.null106 ] -// CHECK-LL-NEXT: %cmp108 = icmp eq %class.test1_A* %tmp100, %61 -// CHECK-LL-NEXT: br i1 %cmp108, label %if.then109, label %if.else111 -// CHECK-LL: if.then109: -// CHECK-LL-NEXT: %call110 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i32 0, i32 0), i32 12) -// CHECK-LL-NEXT: br label %if.end113 -// CHECK-LL: if.else111: -// CHECK-LL-NEXT: %call112 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str1, i32 0, i32 0), i32 12) -// CHECK-LL-NEXT: br label %if.end113 -// CHECK-LL: if.end113: -// CHECK-LL-NEXT: br i1 false, label %cast.null116, label %cast.notnull115 -// CHECK-LL: cast.notnull115: -// CHECK-LL-NEXT: br label %cast.end117 -// CHECK-LL: cast.null116: -// CHECK-LL-NEXT: br label %cast.end117 -// CHECK-LL: cast.end117: -// CHECK-LL-NEXT: %62 = phi %class.test1_E* [ bitcast (%class.test1_F* @test1_f to %class.test1_E*), %cast.notnull115 ], [ null, %cast.null116 ] -// CHECK-LL-NEXT: store %class.test1_E* %62, %class.test1_E** %ep -// CHECK-LL-NEXT: %tmp118 = load %class.test1_E** %ep -// CHECK-LL-NEXT: br i1 false, label %cast.null120, label %cast.notnull119 -// CHECK-LL: cast.notnull119: -// CHECK-LL-NEXT: br label %cast.end121 -// CHECK-LL: cast.null120: -// CHECK-LL-NEXT: br label %cast.end121 -// CHECK-LL: cast.end121: -// CHECK-LL-NEXT: %63 = phi %class.test1_E* [ bitcast (%class.test1_F* @test1_f to %class.test1_E*), %cast.notnull119 ], [ null, %cast.null120 ] -// CHECK-LL-NEXT: %cmp122 = icmp eq %class.test1_E* %tmp118, %63 -// CHECK-LL-NEXT: br i1 %cmp122, label %if.then123, label %if.else125 -// CHECK-LL: if.then123: -// CHECK-LL-NEXT: %call124 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i32 0, i32 0), i32 13) -// CHECK-LL-NEXT: br label %if.end127 -// CHECK-LL: if.else125: -// CHECK-LL-NEXT: %call126 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str1, i32 0, i32 0), i32 13) -// CHECK-LL-NEXT: br label %if.end127 -// CHECK-LL: if.end127: -// CHECK-LL-NEXT: %tmp129 = load %class.test1_A** %ap -// CHECK-LL-NEXT: %64 = icmp ne %class.test1_A* %tmp129, null -// CHECK-LL-NEXT: br i1 %64, label %65, label %70 -// CHECK-LL: ; <label>:65 -// CHECK-LL-NEXT: %66 = bitcast %class.test1_A* %tmp129 to i64** -// CHECK-LL-NEXT: %vtable130 = load i64** %66 -// CHECK-LL-NEXT: %67 = getelementptr inbounds i64* %vtable130, i64 -2 -// CHECK-LL-NEXT: %"offset to top" = load i64* %67 -// CHECK-LL-NEXT: %68 = bitcast %class.test1_A* %tmp129 to i8* -// CHECK-LL-NEXT: %69 = getelementptr inbounds i8* %68, i64 %"offset to top" -// CHECK-LL-NEXT: br label %71 -// CHECK-LL: ; <label>:70 -// CHECK-LL-NEXT: br label %71 -// CHECK-LL: ; <label>:71 -// CHECK-LL-NEXT: %72 = phi i8* [ %69, %65 ], [ null, %70 ] -// CHECK-LL-NEXT: store i8* %72, i8** %vp -// CHECK-LL-NEXT: %tmp131 = load i8** %vp -// CHECK-LL-NEXT: %cmp132 = icmp eq i8* %tmp131, getelementptr inbounds (%class.test1_D* @test1_d, i32 0, i32 0, i32 0) -// CHECK-LL-NEXT: br i1 %cmp132, label %if.then133, label %if.else135 -// CHECK-LL: if.then133: -// CHECK-LL-NEXT: %call134 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i32 0, i32 0), i32 14) -// CHECK-LL-NEXT: br label %if.end137 -// CHECK-LL: if.else135: -// CHECK-LL-NEXT: %call136 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str1, i32 0, i32 0), i32 14) -// CHECK-LL-NEXT: br label %if.end137 -// CHECK-LL: if.end137: -// CHECK-LL-NEXT: %tmp139 = load %class.test1_A** %ap -// CHECK-LL-NEXT: %73 = icmp ne %class.test1_A* %tmp139, null -// CHECK-LL-NEXT: br i1 %73, label %74, label %79 -// CHECK-LL: ; <label>:74 -// CHECK-LL-NEXT: %75 = bitcast %class.test1_A* %tmp139 to i64** -// CHECK-LL-NEXT: %vtable140 = load i64** %75 -// CHECK-LL-NEXT: %76 = getelementptr inbounds i64* %vtable140, i64 -2 -// CHECK-LL-NEXT: %"offset to top141" = load i64* %76 -// CHECK-LL-NEXT: %77 = bitcast %class.test1_A* %tmp139 to i8* -// CHECK-LL-NEXT: %78 = getelementptr inbounds i8* %77, i64 %"offset to top141" -// CHECK-LL-NEXT: br label %80 -// CHECK-LL: ; <label>:79 -// CHECK-LL-NEXT: br label %80 -// CHECK-LL: ; <label>:80 -// CHECK-LL-NEXT: %81 = phi i8* [ %78, %74 ], [ null, %79 ] -// CHECK-LL-NEXT: store i8* %81, i8** %cvp -// CHECK-LL-NEXT: %tmp142 = load i8** %cvp -// CHECK-LL-NEXT: %cmp143 = icmp eq i8* %tmp142, getelementptr inbounds (%class.test1_D* @test1_d, i32 0, i32 0, i32 0) -// CHECK-LL-NEXT: br i1 %cmp143, label %if.then144, label %if.else146 -// CHECK-LL: if.then144: -// CHECK-LL-NEXT: %call145 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i32 0, i32 0), i32 15) -// CHECK-LL-NEXT: br label %if.end148 -// CHECK-LL: if.else146: -// CHECK-LL-NEXT: %call147 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str1, i32 0, i32 0), i32 15) -// CHECK-LL-NEXT: br label %if.end148 -// CHECK-LL: if.end148: +// CHECK-LL: [[bp:%.*]] = alloca %class.test1_A*, align 8 +// CHECK-LL-NEXT: [[ap:%.*]] = alloca %class.test1_A*, align 8 +// CHECK-LL-NEXT: [[dp:%.*]] = alloca %class.test1_D*, align 8 +// CHECK-LL-NEXT: [[ap37:%.*]] = alloca %class.test1_A*, align 8 +// CHECK-LL-NEXT: [[dp53:%.*]] = alloca %class.test1_D*, align 8 +// CHECK-LL-NEXT: [[ep1:%.*]] = alloca %class.test1_E*, align 8 +// CHECK-LL-NEXT: [[cdp:%.*]] = alloca %class.test1_D*, align 8 +// CHECK-LL-NEXT: [[ep:%.*]] = alloca %class.test1_E*, align 8 +// CHECK-LL-NEXT: [[vp:%.*]] = alloca i8*, align 8 +// CHECK-LL-NEXT: [[cvp:%.*]] = alloca i8*, align 8 +// CHECK-LL-NEXT: br i1 false, label %[[castnull:.*]], label %[[castnotnull:.*]] +// CHECK-LL: [[castnotnull]] +// CHECK-LL-NEXT: br label %[[castend:.*]] +// CHECK-LL: [[castnull]] +// CHECK-LL-NEXT: br label %[[castend]] +// CHECK-LL: [[castend]] +// CHECK-LL-NEXT: [[v0:%.*]] = phi %class.test1_A* [ bitcast (%class.test1_D* @test1_d to %class.test1_A*), %[[castnotnull]] ], [ null, %[[castnull]] ] +// CHECK-LL-NEXT: store %class.test1_A* [[v0]], %class.test1_A** [[bp]] +// CHECK-LL-NEXT: br i1 false, label %[[castnull2:.*]], label %[[castnotnull1:.*]] +// CHECK-LL: [[castnotnull1]] +// CHECK-LL-NEXT: [[vtable:%.*]] = load i8** bitcast (%class.test1_D* @test1_d to i8**) +// CHECK-LL-NEXT: [[vbaseoffsetptr:%.*]] = getelementptr i8* [[vtable]], i64 -24 +// CHECK-LL-NEXT: [[v1:%.*]] = bitcast i8* [[vbaseoffsetptr]] to i64* +// CHECK-LL-NEXT: [[vbaseoffset:%.*]] = load i64* [[v1]] +// CHECK-LL-NEXT: [[addptr:%.*]] = getelementptr i8* getelementptr inbounds (%class.test1_D* @test1_d, i32 0, i32 0, i32 0), i64 [[vbaseoffset:.*]] +// CHECK-LL-NEXT: [[v2:%.*]] = bitcast i8* [[addptr]] to %class.test1_A* +// CHECK-LL-NEXT: br label %[[castend3:.*]] +// CHECK-LL: [[castnull2]] +// CHECK-LL-NEXT: br label %[[castend3]] +// CHECK-LL: [[castend3]] +// CHECK-LL-NEXT: [[v3:%.*]] = phi %class.test1_A* [ [[v2]], %[[castnotnull1]] ], [ null, %[[castnull2]] ] +// CHECK-LL-NEXT: store %class.test1_A* [[v3]], %class.test1_A** [[ap]] +// CHECK-LL-NEXT: [[tmp:%.*]] = load %class.test1_A** [[bp]] +// CHECK-LL-NEXT: [[v4:%.*]] = icmp ne %class.test1_A* [[tmp]], null +// CHECK-LL-NEXT: br i1 [[v4]], label %[[v5:.*]], label %[[v9:.*]] +// CHECK-LL: ; <label>:[[v5]] +// CHECK-LL-NEXT: [[v6:%.*]] = bitcast %class.test1_A* [[tmp]] to i8* +// CHECK-LL-NEXT: [[v7:%.*]] = call i8* @__dynamic_cast(i8* [[v6]], i8* bitcast (%0* @_ZTI7test1_B to i8*), i8* bitcast (%1* @_ZTI7test1_D to i8*), i64 -1) ; <i8*> [#uses=1] +// CHECK-LL-NEXT: [[v8:%.*]] = bitcast i8* [[v7]] to %class.test1_D* +// CHECK-LL-NEXT: br label %[[v10:.*]] +// CHECK-LL: ; <label>:[[v9]] +// CHECK-LL-NEXT: br label %[[v10]] +// CHECK-LL: ; <label>:[[v10]] +// CHECK-LL-NEXT: [[v11:%.*]] = phi %class.test1_D* [ [[v8]], %[[v5]] ], [ null, %[[v9]] ] +// CHECK-LL-NEXT: store %class.test1_D* [[v11]], %class.test1_D** [[dp]] +// CHECK-LL-NEXT: [[tmp4:%.*]] = load %class.test1_D** [[dp]] +// CHECK-LL-NEXT: [[cmp:%.*]] = icmp eq %class.test1_D* [[tmp4]], null +// CHECK-LL-NEXT: br i1 [[cmp]], label %[[ifthen:.*]], label %[[ifelse:.*]] +// CHECK-LL: [[ifthen]] +// CHECK-LL-NEXT: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i32 0, i32 0), i32 1) +// CHECK-LL-NEXT: br label %[[ifend:.*]] +// CHECK-LL: [[ifelse]] +// CHECK-LL-NEXT: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str1, i32 0, i32 0), i32 1) +// CHECK-LL-NEXT: br label %[[ifend]] +// CHECK-LL: [[ifend]] +// CHECK-LL-NEXT: [[tmp6:%.*]] = load %class.test1_A** [[bp]] +// CHECK-LL-NEXT: [[v12:%.*]] = icmp ne %class.test1_A* [[tmp6]], null +// CHECK-LL-NEXT: br i1 [[v12]], label %[[v13:.*]], label %[[v17:.*]] +// CHECK-LL: ; <label>:[[v13]] +// CHECK-LL-NEXT: [[v14:%.*]] = bitcast %class.test1_A* [[tmp6]] to i8* +// CHECK-LL-NEXT: [[v15:%.*]] = call i8* @__dynamic_cast(i8* [[v14]], i8* bitcast ({{.*}} @_ZTI7test1_B to i8*), i8* bitcast ({{.*}} @_ZTI7test1_A to i8*), i64 -1) +// CHECK-LL-NEXT: [[v16:%.*]] = bitcast i8* [[v15]] to %class.test1_A* +// CHECK-LL-NEXT: br label %[[v18:.*]] +// CHECK-LL: ; <label>:[[v17]] +// CHECK-LL-NEXT: br label %[[v18]] +// CHECK-LL: ; <label>:[[v18]] +// CHECK-LL-NEXT: [[v19:%.*]] = phi %class.test1_A* [ [[v16]], %[[v13]] ], [ null, %[[v17]] ] +// CHECK-LL-NEXT: store %class.test1_A* [[v19]], %class.test1_A** [[ap]] +// CHECK-LL-NEXT: [[tmp7:%.*]] = load %class.test1_A** [[ap]] +// CHECK-LL-NEXT: [[cmp8:%.*]] = icmp eq %class.test1_A* [[tmp7]], null +// CHECK-LL-NEXT: br i1 [[cmp8]], label %[[ifthen9:.*]], label %[[ifelse11:.*]] +// CHECK-LL: [[ifthen9]] +// CHECK-LL-NEXT: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i32 0, i32 0), i32 2) +// CHECK-LL-NEXT: br label %[[ifend13:.*]] +// CHECK-LL: [[ifelse11]] +// CHECK-LL-NEXT: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str1, i32 0, i32 0), i32 2) +// CHECK-LL-NEXT: br label %[[ifend13]] +// CHECK-LL: [[ifend13]] +// CHECK-LL-NEXT: [[tmp14:%.*]] = load %class.test1_A** [[ap]] +// CHECK-LL-NEXT: [[v20:%.*]] = icmp ne %class.test1_A* [[tmp14]], null +// CHECK-LL-NEXT: br i1 [[v20]], label %[[v21:.*]], label %[[v25:.*]] +// CHECK-LL: ; <label>:[[v21]] +// CHECK-LL-NEXT: [[v22:%.*]] = bitcast %class.test1_A* [[tmp14]] to i8* +// CHECK-LL-NEXT: [[v23:%.*]] = call i8* @__dynamic_cast({{.*}} [[v22]], i8* bitcast ({{.*}} @_ZTI7test1_A to i8*), i8* bitcast ({{.*}} @_ZTI7test1_B to i8*), i64 -1) +// CHECK-LL-NEXT: [[v24:%.*]] = bitcast i8* [[v23]] to %class.test1_A* +// CHECK-LL-NEXT: br label %[[v26:.*]] +// CHECK-LL: ; <label>:[[v25]] +// CHECK-LL-NEXT: br label %[[v26]] +// CHECK-LL: ; <label>:[[v26]] +// CHECK-LL-NEXT: [[v27:%.*]] = phi %class.test1_A* [ [[v24]], %[[v21]] ], [ null, %[[v25]] ] +// CHECK-LL-NEXT: store %class.test1_A* [[v27]], %class.test1_A** [[bp]] +// CHECK-LL-NEXT: [[tmp15:%.*]] = load %class.test1_A** [[bp]] +// CHECK-LL-NEXT: [[cmp16:%.*]] = icmp eq %class.test1_A* [[tmp15]], null +// CHECK-LL-NEXT: br i1 [[cmp16]], label %[[ifthen17:.*]], label %[[ifelse19:.*]] +// CHECK-LL: [[ifthen17]] +// CHECK-LL-NEXT: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i32 0, i32 0), i32 3) +// CHECK-LL-NEXT: br label %[[ifend21:.*]] +// CHECK-LL: [[ifelse19]] +// CHECK-LL-NEXT: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str1, i32 0, i32 0), i32 3) +// CHECK-LL-NEXT: br label %[[ifend21]] +// CHECK-LL: [[ifend21]] +// CHECK-LL-NEXT: br i1 false, label %[[castnull27:.*]], label %[[castnotnull22:.*]] +// CHECK-LL: [[castnotnull22]] +// CHECK-LL-NEXT: [[vtable23:%.*]] = load i8** bitcast (%class.test1_D* @test1_d to i8**) +// CHECK-LL-NEXT: [[vbaseoffsetptr24:%.*]] = getelementptr i8* [[vtable23]], i64 -24 +// CHECK-LL-NEXT: [[v28:%.*]] = bitcast i8* [[vbaseoffsetptr24]] to i64* +// CHECK-LL-NEXT: [[vbaseoffset25:%.*]] = load i64* [[v28]] +// CHECK-LL-NEXT: [[addptr26:%.*]] = getelementptr i8* getelementptr inbounds (%class.test1_D* @test1_d, i32 0, i32 0, i32 0), i64 [[vbaseoffset25]] +// CHECK-LL-NEXT: [[v29:%.*]] = bitcast i8* [[addptr26]] to %class.test1_A* +// CHECK-LL-NEXT: br label %[[castend28:.*]] +// CHECK-LL: [[castnull27]] +// CHECK-LL-NEXT: br label %[[castend28]] +// CHECK-LL: [[castend28]] +// CHECK-LL-NEXT: [[v30:%.*]] = phi %class.test1_A* [ [[v29]], %[[castnotnull22]] ], [ null, %[[castnull27]] ] +// CHECK-LL-NEXT: store %class.test1_A* [[v30]], %class.test1_A** [[ap]] +// CHECK-LL-NEXT: [[tmp29:%.*]] = load %class.test1_A** [[ap]] +// CHECK-LL-NEXT: [[cmp30:%.*]] = icmp ne %class.test1_A* [[tmp29]], null +// CHECK-LL-NEXT: br i1 [[cmp30]], label %[[ifthen31:.*]], label %[[ifelse33:.*]] +// CHECK-LL: [[ifthen31]] +// CHECK-LL-NEXT: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i32 0, i32 0), i32 4) +// CHECK-LL-NEXT: br label %[[ifend35:.*]] +// CHECK-LL: [[ifelse33]] +// CHECK-LL-NEXT: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str1, i32 0, i32 0), i32 4) +// CHECK-LL-NEXT: br label %[[ifend35]] +// CHECK-LL: [[ifend35]] +// CHECK-LL-NEXT: br i1 false, label %[[castnull43:.*]], label %[[castnotnull38:.*]] +// CHECK-LL: [[castnotnull38]] +// CHECK-LL-NEXT: [[vtable39:%.*]] = load i8** bitcast (%class.test1_F* @test1_f to i8**) +// CHECK-LL-NEXT: [[vbaseoffsetptr40:%.*]] = getelementptr i8* [[vtable39]], i64 -24 +// CHECK-LL-NEXT: [[v31:%.*]] = bitcast i8* [[vbaseoffsetptr40]] to i64* +// CHECK-LL-NEXT: [[vbaseoffset41:%.*]] = load i64* [[v31]] +// CHECK-LL-NEXT: [[addptr42:%.*]] = getelementptr i8* getelementptr inbounds (%class.test1_F* @test1_f, i32 0, i32 0, i32 0), i64 [[vbaseoffset41]] +// CHECK-LL-NEXT: [[v32:%.*]] = bitcast i8* [[addptr42]] to %class.test1_A* +// CHECK-LL-NEXT: br label %[[castend44:.*]] +// CHECK-LL: [[castnull43]] +// CHECK-LL-NEXT: br label %[[castend44]] +// CHECK-LL: [[castend44]] +// CHECK-LL-NEXT: [[v33:%.*]] = phi %class.test1_A* [ [[v32]], %[[castnotnull38]] ], [ null, %[[castnull43]] ] +// CHECK-LL-NEXT: store %class.test1_A* [[v33]], %class.test1_A** [[ap37]] +// CHECK-LL-NEXT: [[tmp45:%.*]] = load %class.test1_A** [[ap37]] +// CHECK-LL-NEXT: [[cmp46:%.*]] = icmp ne %class.test1_A* [[tmp45]], null +// CHECK-LL-NEXT: br i1 [[cmp46]], label %[[ifthen47:.*]], label %[[ifelse49:.*]] +// CHECK-LL: [[ifthen47]] +// CHECK-LL-NEXT: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i32 0, i32 0), i32 6) +// CHECK-LL-NEXT: br label %[[ifend51:.*]] +// CHECK-LL: [[ifelse49]] +// CHECK-LL-NEXT: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str1, i32 0, i32 0), i32 6) +// CHECK-LL-NEXT: br label %[[ifend51]] +// CHECK-LL: [[ifend51]] +// CHECK-LL-NEXT: [[tmp54:%.*]] = load %class.test1_A** [[ap37]] +// CHECK-LL-NEXT: [[v34:%.*]] = icmp ne %class.test1_A* [[tmp54]], null +// CHECK-LL-NEXT: br i1 [[v34]], label %[[v35:.*]], label %[[v39:.*]] +// CHECK-LL: ; <label>:[[v35]] +// CHECK-LL-NEXT: [[v36:%.*]] = bitcast %class.test1_A* [[tmp54]] to i8* +// CHECK-LL-NEXT: [[v37:%.*]] = call i8* @__dynamic_cast(i8* [[v36]], i8* bitcast ({{.*}} @_ZTI7test1_A to i8*), i8* bitcast ({{.*}} @_ZTI7test1_D to i8*), i64 -1) +// CHECK-LL-NEXT: [[v38:%.*]] = bitcast i8* [[v37]] to %class.test1_D* +// CHECK-LL-NEXT: br label %[[v40:.*]] +// CHECK-LL: ; <label>:[[v39]] +// CHECK-LL-NEXT: br label %[[v40]] +// CHECK-LL: ; <label>:[[v40]] +// CHECK-LL-NEXT: [[v41:%.*]] = phi %class.test1_D* [ [[v38]], %[[v35]] ], [ null, %[[v39]] ] +// CHECK-LL-NEXT: store %class.test1_D* [[v41]], %class.test1_D** [[dp53]] +// CHECK-LL-NEXT: [[tmp55:%.*]] = load %class.test1_D** [[dp53]] +// CHECK-LL-NEXT: [[cmp56:%.*]] = icmp eq %class.test1_D* [[tmp55]], null +// CHECK-LL-NEXT: br i1 [[cmp56]], label %[[ifthen57:.*]], label %[[ifelse59:.*]] +// CHECK-LL: [[ifthen57]] +// CHECK-LL-NEXT: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i32 0, i32 0), i32 7) +// CHECK-LL-NEXT: br label %[[ifend61:.*]] +// CHECK-LL: [[ifelse59]] +// CHECK-LL-NEXT: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str1, i32 0, i32 0), i32 7) +// CHECK-LL-NEXT: br label %[[ifend61]] +// CHECK-LL: [[ifend61]] +// CHECK-LL-NEXT: [[tmp63:%.*]] = load %class.test1_A** [[ap37]] +// CHECK-LL-NEXT: [[v42:%.*]] = icmp ne %class.test1_A* [[tmp63]], null +// CHECK-LL-NEXT: br i1 [[v42]], label %[[v43:.*]], label %[[v47:.*]] +// CHECK-LL: ; <label>:[[v43]] +// CHECK-LL-NEXT: [[v44:%.*]] = bitcast %class.test1_A* [[tmp63]] to i8* +// CHECK-LL-NEXT: [[v45:%.*]] = call i8* @__dynamic_cast(i8* [[v44]], i8* bitcast ({{.*}} @_ZTI7test1_A to i8*), i8* bitcast ({{.*}} @_ZTI7test1_E to i8*), i64 -1) +// CHECK-LL-NEXT: [[v46:%.*]] = bitcast i8* [[v45]] to %class.test1_E* +// CHECK-LL-NEXT: br label %[[v48:.*]] +// CHECK-LL: ; <label>:[[v47]] +// CHECK-LL-NEXT: br label %[[v48]] +// CHECK-LL: ; <label>:[[v48]] +// CHECK-LL-NEXT: [[v49:%.*]] = phi %class.test1_E* [ [[v46]], %[[v43]] ], [ null, %[[v47]] ] +// CHECK-LL-NEXT: store %class.test1_E* [[v49]], %class.test1_E** [[ep1]] +// CHECK-LL-NEXT: [[tmp64:%.*]] = load %class.test1_E** [[ep1]] +// CHECK-LL-NEXT: [[cmp65:%.*]] = icmp ne %class.test1_E* [[tmp64]], null +// CHECK-LL-NEXT: br i1 [[cmp65]], label %[[ifthen66:.*]], label %[[ifelse68:.*]] +// CHECK-LL: [[ifthen66]] +// CHECK-LL-NEXT: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i32 0, i32 0), i32 8) +// CHECK-LL-NEXT: br label %[[ifend70:.*]] +// CHECK-LL: [[ifelse68]] +// CHECK-LL-NEXT: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str1, i32 0, i32 0), i32 8) +// CHECK-LL-NEXT: br label %[[ifend70]] +// CHECK-LL: [[ifend70]] +// CHECK-LL-NEXT: store %class.test1_D* @test1_d, %class.test1_D** [[dp]] +// CHECK-LL-NEXT: [[tmp71:%.*]] = load %class.test1_D** [[dp]] +// CHECK-LL-NEXT: [[cmp72:%.*]] = icmp eq %class.test1_D* [[tmp71]], @test1_d +// CHECK-LL-NEXT: br i1 [[cmp72]], label %[[ifthen73:.*]], label %[[ifelse75:.*]] +// CHECK-LL: [[ifthen73]] +// CHECK-LL-NEXT: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i32 0, i32 0), i32 9) +// CHECK-LL-NEXT: br label %[[ifend77:.*]] +// CHECK-LL: [[ifelse75]] +// CHECK-LL-NEXT: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str1, i32 0, i32 0), i32 9) +// CHECK-LL-NEXT: br label %[[ifend77]] +// CHECK-LL: [[ifend77]] +// CHECK-LL-NEXT: store %class.test1_D* @test1_d, %class.test1_D** [[cdp]] +// CHECK-LL-NEXT: [[tmp79:%.*]] = load %class.test1_D** [[cdp]] +// CHECK-LL-NEXT: [[cmp80:%.*]] = icmp eq %class.test1_D* [[tmp79]], @test1_d +// CHECK-LL-NEXT: br i1 [[cmp80]], label %[[ifthen81:.*]], label %[[ifelse83:.*]] +// CHECK-LL: [[ifthen81]] +// CHECK-LL-NEXT: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i32 0, i32 0), i32 10) +// CHECK-LL-NEXT: br label %[[ifend85:.*]] +// CHECK-LL: [[ifelse83]] +// CHECK-LL-NEXT: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str1, i32 0, i32 0), i32 10) +// CHECK-LL-NEXT: br label %[[ifend85]] +// CHECK-LL: [[ifend85]] +// CHECK-LL-NEXT: br i1 false, label %[[v50:.*]], label %[[v53:.*]] +// CHECK-LL: ; <label>:[[v50]] +// CHECK-LL-NEXT: [[v51:%.*]] = call i8* @__dynamic_cast(i8* null, i8* bitcast ({{.*}}* @_ZTI7test1_A to i8*), i8* bitcast ({{.*}} @_ZTI7test1_D to i8*), i64 -1) +// CHECK-LL-NEXT: [[v52:%.*]] = bitcast i8* [[v51]] to %class.test1_D* +// CHECK-LL-NEXT: br label %[[v54:.*]] +// CHECK-LL: ; <label>:[[v53]] +// CHECK-LL-NEXT: br label %[[v54]] +// CHECK-LL: ; <label>:[[v54]] +// CHECK-LL-NEXT: [[v55:%.*]] = phi %class.test1_D* [ [[v52]], %[[v50]] ], [ null, %[[v53]] ] +// CHECK-LL-NEXT: store %class.test1_D* [[v55]], %class.test1_D** [[dp]] +// CHECK-LL-NEXT: [[tmp86:%.*]] = load %class.test1_D** [[dp]] +// CHECK-LL-NEXT: [[cmp87:%.*]] = icmp eq %class.test1_D* [[tmp86]], null +// CHECK-LL-NEXT: br i1 [[cmp87]], label %[[ifthen88:.*]], label %[[ifelse90:.*]] +// CHECK-LL: [[ifthen88]] +// CHECK-LL-NEXT: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i32 0, i32 0), i32 11) +// CHECK-LL-NEXT: br label %[[ifend92:.*]] +// CHECK-LL: [[ifelse90]] +// CHECK-LL-NEXT: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str1, i32 0, i32 0), i32 11) +// CHECK-LL-NEXT: br label %[[ifend92]] +// CHECK-LL: [[ifend92]] +// CHECK-LL-NEXT: br i1 false, label %[[castnull98:.*]], label %[[castnotnull93:.*]] +// CHECK-LL: [[castnotnull93]] +// CHECK-LL-NEXT: [[vtable94:%.*]] = load i8** bitcast (%class.test1_D* @test1_d to i8**) +// CHECK-LL-NEXT: [[vbaseoffsetptr95:%.*]] = getelementptr i8* [[vtable94]], i64 -24 +// CHECK-LL-NEXT: [[v56:%.*]] = bitcast i8* [[vbaseoffsetptr95]] to i64* +// CHECK-LL-NEXT: [[vbaseoffset96:%.*]] = load i64* [[v56]] +// CHECK-LL-NEXT: [[addptr97:%.*]] = getelementptr i8* getelementptr inbounds (%class.test1_D* @test1_d, i32 0, i32 0, i32 0), i64 [[vbaseoffset96]] +// CHECK-LL-NEXT: [[v57:%.*]] = bitcast i8* [[addptr97]] to %class.test1_A* +// CHECK-LL-NEXT: br label %[[castend99:.*]] +// CHECK-LL: [[castnull98]] +// CHECK-LL-NEXT: br label %[[castend99]] +// CHECK-LL: [[castend99]] +// CHECK-LL-NEXT: [[v58:%.*]] = phi %class.test1_A* [ [[v57]], %[[castnotnull93]] ], [ null, %[[castnull98]] ] +// CHECK-LL-NEXT: store %class.test1_A* [[v58]], %class.test1_A** [[ap]] +// CHECK-LL-NEXT: [[tmp100:%.*]] = load %class.test1_A** [[ap]] +// CHECK-LL-NEXT: br i1 false, label %[[castnull106:.*]], label %[[castnotnull101:.*]] +// CHECK-LL: [[castnotnull101]] +// CHECK-LL-NEXT: [[vtable102:%.*]] = load i8** bitcast (%class.test1_D* @test1_d to i8**) +// CHECK-LL-NEXT: [[vbaseoffsetptr103:%.*]] = getelementptr i8* [[vtable102]], i64 -24 +// CHECK-LL-NEXT: [[v59:%.*]] = bitcast i8* [[vbaseoffsetptr103]] to i64* +// CHECK-LL-NEXT: [[vbaseoffset104:%.*]] = load i64* [[v59]] +// CHECK-LL-NEXT: [[addptr105:%.*]] = getelementptr i8* getelementptr inbounds (%class.test1_D* @test1_d, i32 0, i32 0, i32 0), i64 [[vbaseoffset104]] +// CHECK-LL-NEXT: [[v60:%.*]] = bitcast i8* [[addptr105]] to %class.test1_A* +// CHECK-LL-NEXT: br label %[[castend107:.*]] +// CHECK-LL: [[castnull106]] +// CHECK-LL-NEXT: br label %[[castend107]] +// CHECK-LL: [[castend107]] +// CHECK-LL-NEXT: [[v61:%.*]] = phi %class.test1_A* [ [[v60]], %[[castnotnull101]] ], [ null, %[[castnull106]] ] +// CHECK-LL-NEXT: [[cmp108:%.*]] = icmp eq %class.test1_A* [[tmp100]], [[v61]] +// CHECK-LL-NEXT: br i1 [[cmp108]], label %[[ifthen109:.*]], label %[[ifelse111:.*]] +// CHECK-LL: [[ifthen109]] +// CHECK-LL-NEXT: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i32 0, i32 0), i32 12) +// CHECK-LL-NEXT: br label %[[ifend113:.*]] +// CHECK-LL: [[ifelse111]] +// CHECK-LL-NEXT: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str1, i32 0, i32 0), i32 12) +// CHECK-LL-NEXT: br label %[[ifend113]] +// CHECK-LL: [[ifend113]] +// CHECK-LL-NEXT: br i1 false, label %[[castnull116:.*]], label %[[castnotnull115:.*]] +// CHECK-LL: [[castnotnull115]] +// CHECK-LL-NEXT: br label %[[castend117:.*]] +// CHECK-LL: [[castnull116]] +// CHECK-LL-NEXT: br label %[[castend117]] +// CHECK-LL: [[castend117]] +// CHECK-LL-NEXT: [[v62:%.*]] = phi %class.test1_E* [ bitcast (%class.test1_F* @test1_f to %class.test1_E*), %[[castnotnull115]] ], [ null, %[[castnull116]] ] +// CHECK-LL-NEXT: store %class.test1_E* [[v62]], %class.test1_E** [[ep]] +// CHECK-LL-NEXT: [[tmp118:%.*]] = load %class.test1_E** [[ep]] +// CHECK-LL-NEXT: br i1 false, label %[[castnull120:.*]], label %[[castnotnull119:.*]] +// CHECK-LL: [[castnotnull119]] +// CHECK-LL-NEXT: br label %[[castend121:.*]] +// CHECK-LL: [[castnull120]] +// CHECK-LL-NEXT: br label %[[castend121]] +// CHECK-LL: [[castend121]] +// CHECK-LL-NEXT: [[v63:%.*]] = phi %class.test1_E* [ bitcast (%class.test1_F* @test1_f to %class.test1_E*), %[[castnotnull119]] ], [ null, %[[castnull120]] ] +// CHECK-LL-NEXT: [[cmp122:%.*]] = icmp eq %class.test1_E* [[tmp118]], [[v63]] +// CHECK-LL-NEXT: br i1 [[cmp122]], label %[[ifthen123:.*]], label %[[ifelse125:.*]] +// CHECK-LL: [[ifthen123]] +// CHECK-LL-NEXT: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i32 0, i32 0), i32 13) +// CHECK-LL-NEXT: br label %[[ifend127:.*]] +// CHECK-LL: [[ifelse125]] +// CHECK-LL-NEXT: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str1, i32 0, i32 0), i32 13) +// CHECK-LL-NEXT: br label %[[ifend127]] +// CHECK-LL: [[ifend127]] +// CHECK-LL-NEXT: [[tmp129:%.*]] = load %class.test1_A** [[ap]] +// CHECK-LL-NEXT: [[v64:%.*]] = icmp ne %class.test1_A* [[tmp129]], null +// CHECK-LL-NEXT: br i1 [[v64]], label %[[v65:.*]], label %[[v70:.*]] +// CHECK-LL: ; <label>:[[v65]] +// CHECK-LL-NEXT: [[v66:%.*]] = bitcast %class.test1_A* [[tmp129]] to i64** +// CHECK-LL-NEXT: [[vtable130:%.*]] = load i64** [[v66]] +// CHECK-LL-NEXT: [[v67:%.*]] = getelementptr inbounds i64* [[vtable130]], i64 -2 +// CHECK-LL-NEXT: [[offsettotop:%.*]] = load i64* [[v67]] +// CHECK-LL-NEXT: [[v68:%.*]] = bitcast %class.test1_A* [[tmp129]] to i8* +// CHECK-LL-NEXT: [[v69:%.*]] = getelementptr inbounds i8* [[v68]], i64 [[offsettotop]] +// CHECK-LL-NEXT: br label %[[v71:.*]] +// CHECK-LL: ; <label>:[[v70]] +// CHECK-LL-NEXT: br label %[[v71]] +// CHECK-LL: ; <label>:[[v71]] +// CHECK-LL-NEXT: [[v72:%.*]] = phi i8* [ [[v69]], %[[v65]] ], [ null, %[[v70]] ] +// CHECK-LL-NEXT: store i8* [[v72]], i8** [[vp]] +// CHECK-LL-NEXT: [[tmp131:%.*]] = load i8** [[vp]] +// CHECK-LL-NEXT: [[cmp132:%.*]] = icmp eq i8* [[tmp131]], getelementptr inbounds (%class.test1_D* @test1_d, i32 0, i32 0, i32 0) +// CHECK-LL-NEXT: br i1 [[cmp132]], label %[[ifthen133:.*]], label %[[ifelse135:.*]] +// CHECK-LL: [[ifthen133]] +// CHECK-LL-NEXT: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i32 0, i32 0), i32 14) +// CHECK-LL-NEXT: br label %[[ifend137:.*]] +// CHECK-LL: [[ifelse135]] +// CHECK-LL-NEXT: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str1, i32 0, i32 0), i32 14) +// CHECK-LL-NEXT: br label %[[ifend137]] +// CHECK-LL: [[ifend137]] +// CHECK-LL-NEXT: [[tmp139:%.*]] = load %class.test1_A** [[ap]] +// CHECK-LL-NEXT: [[v73:%.*]] = icmp ne %class.test1_A* [[tmp139]], null +// CHECK-LL-NEXT: br i1 [[v73]], label %[[v74:.*]], label %[[v79:.*]] +// CHECK-LL: ; <label>:[[v74]] +// CHECK-LL-NEXT: [[v75:%.*]] = bitcast %class.test1_A* [[tmp139]] to i64** +// CHECK-LL-NEXT: [[vtable140:%.*]] = load i64** [[v75]] +// CHECK-LL-NEXT: [[v76:%.*]] = getelementptr inbounds i64* [[vtable140]], i64 -2 +// CHECK-LL-NEXT: [[offsettotop141:%.*]] = load i64* [[v76]] +// CHECK-LL-NEXT: [[v77:%.*]] = bitcast %class.test1_A* [[tmp139]] to i8* +// CHECK-LL-NEXT: [[v78:%.*]] = getelementptr inbounds i8* [[v77]], i64 [[offsettotop141]] +// CHECK-LL-NEXT: br label %[[v80:.*]] +// CHECK-LL: ; <label>:[[v79]] +// CHECK-LL-NEXT: br label %[[v80]] +// CHECK-LL: ; <label>:[[v80]] +// CHECK-LL-NEXT: [[v81:%.*]] = phi i8* [ [[v78]], %[[v74]] ], [ null, %[[v79]] ] +// CHECK-LL-NEXT: store i8* [[v81]], i8** [[cvp]] +// CHECK-LL-NEXT: [[tmp142:%.*]] = load i8** [[cvp]] +// CHECK-LL-NEXT: [[cmp143:%.*]] = icmp eq i8* [[tmp142]], getelementptr inbounds (%class.test1_D* @test1_d, i32 0, i32 0, i32 0) +// CHECK-LL-NEXT: br i1 [[cmp143]], label %[[ifthen144:.*]], label %[[ifelse146:.*]] +// CHECK-LL: [[ifthen144]] +// CHECK-LL-NEXT: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i32 0, i32 0), i32 15) +// CHECK-LL-NEXT: br label %[[ifend148:.*]] +// CHECK-LL: [[ifelse146]] +// CHECK-LL-NEXT: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str1, i32 0, i32 0), i32 15) +// CHECK-LL-NEXT: br label %[[ifend148]] +// CHECK-LL: [[ifend148]] // CHECK-LL-NEXT: ret void diff --git a/test/CodeGenCXX/eh.cpp b/test/CodeGenCXX/eh.cpp index dd798f4ca32e..d233525f0a48 100644 --- a/test/CodeGenCXX/eh.cpp +++ b/test/CodeGenCXX/eh.cpp @@ -10,14 +10,13 @@ void test1() { } // CHECK: define void @_Z5test1v() nounwind { -// CHECK-NEXT:entry: -// CHECK-NEXT: %exception.ptr = alloca i8* -// CHECK-NEXT: %exception = call i8* @__cxa_allocate_exception(i64 8) -// CHECK-NEXT: store i8* %exception, i8** %exception.ptr -// CHECK-NEXT: %0 = bitcast i8* %exception to %struct.test1_D* -// CHECK-NEXT: %tmp = bitcast %struct.test1_D* %0 to i8* -// CHECK-NEXT: call void @llvm.memcpy.i64(i8* %tmp, i8* bitcast (%struct.test1_D* @d1 to i8*), i64 8, i32 8) -// CHECK-NEXT: call void @__cxa_throw(i8* %exception, i8* bitcast (%0* @_ZTI7test1_D to i8*), i8* null) noreturn +// CHECK: %{{exception.ptr|1}} = alloca i8* +// CHECK-NEXT: %{{exception|2}} = call i8* @__cxa_allocate_exception(i64 8) +// CHECK-NEXT: store i8* %{{exception|2}}, i8** %{{exception.ptr|1}} +// CHECK-NEXT: %{{0|3}} = bitcast i8* %{{exception|2}} to %struct.test1_D* +// CHECK-NEXT: %{{tmp|4}} = bitcast %struct.test1_D* %{{0|3}} to i8* +// CHECK-NEXT: call void @llvm.memcpy.i64(i8* %{{tmp|4}}, i8* bitcast (%struct.test1_D* @d1 to i8*), i64 8, i32 8) +// CHECK-NEXT: call void @__cxa_throw(i8* %{{exception|2}}, i8* bitcast (%0* @_ZTI7test1_D to i8*), i8* null) noreturn // CHECK-NEXT: unreachable @@ -33,14 +32,13 @@ void test2() { } // CHECK: define void @_Z5test2v() nounwind { -// CHECK-NEXT:entry: -// CHECK-NEXT: %exception.ptr = alloca i8* -// CHECK-NEXT: %exception = call i8* @__cxa_allocate_exception(i64 16) -// CHECK-NEXT: store i8* %exception, i8** %exception.ptr -// CHECK-NEXT: %0 = bitcast i8* %exception to %struct.test2_D* -// CHECK: invoke void @_ZN7test2_DC1ERKS_(%struct.test2_D* %0, %struct.test2_D* @d2) -// CHECK-NEXT: to label %invoke.cont unwind label %terminate.handler -// CHECK: call void @__cxa_throw(i8* %exception, i8* bitcast (%0* @_ZTI7test2_D to i8*), i8* null) noreturn +// CHECK: %{{exception.ptr|1}} = alloca i8* +// CHECK-NEXT: %{{exception|2}} = call i8* @__cxa_allocate_exception(i64 16) +// CHECK-NEXT: store i8* %{{exception|2}}, i8** %{{\1}} +// CHECK-NEXT: %{{0|3}} = bitcast i8* %{{exception|2}} to %struct.test2_D* +// CHECK: invoke void @_ZN7test2_DC1ERKS_(%struct.test2_D* %{{0|3}}, %struct.test2_D* @d2) +// CHECK-NEXT: to label %{{invoke.cont|8}} unwind label %{{terminate.handler|4}} +// CHECK: call void @__cxa_throw(i8* %{{exception|2}}, i8* bitcast (%{{0|3}}* @_ZTI7test2_D to i8*), i8* null) noreturn // CHECK-NEXT: unreachable @@ -55,13 +53,12 @@ void test3() { } // CHECK: define void @_Z5test3v() nounwind { -// CHECK-NEXT: entry: -// CHECK-NEXT: %exception.ptr = alloca i8* -// CHECK-NEXT: %exception = call i8* @__cxa_allocate_exception(i64 8) -// CHECK-NEXT: store i8* %exception, i8** %exception.ptr -// CHECK-NEXT: %0 = bitcast i8* %exception to %struct.test3_D** -// CHECK-NEXT: store %struct.test3_D* null, %struct.test3_D** %0 -// CHECK-NEXT: call void @__cxa_throw(i8* %exception, i8* bitcast (%1* @_ZTIPV7test3_D to i8*), i8* null) noreturn +// CHECK: %{{exception.ptr|1}} = alloca i8* +// CHECK-NEXT: %{{exception|2}} = call i8* @__cxa_allocate_exception(i64 8) +// CHECK-NEXT: store i8* %{{exception|2}}, i8** %{{exception.ptr|1}} +// CHECK-NEXT: %{{0|3}} = bitcast i8* %{{exception|2}} to %struct.test3_D** +// CHECK-NEXT: store %struct.test3_D* null, %struct.test3_D** +// CHECK-NEXT: call void @__cxa_throw(i8* %{{exception|2}}, i8* bitcast (%1* @_ZTIPV7test3_D to i8*), i8* null) noreturn // CHECK-NEXT: unreachable @@ -70,6 +67,5 @@ void test4() { } // CHECK: define void @_Z5test4v() nounwind { -// CHECK-NEXT: entry: -// CHECK-NEXT: call void @__cxa_rethrow() noreturn +// CHECK: call void @__cxa_rethrow() noreturn // CHECK-NEXT: unreachable diff --git a/test/CodeGenCXX/expr.cpp b/test/CodeGenCXX/expr.cpp index 6d641dcb622d..d92cfb46a454 100644 --- a/test/CodeGenCXX/expr.cpp +++ b/test/CodeGenCXX/expr.cpp @@ -10,3 +10,7 @@ void test1() { char *xpto; while ( true && xpto[0] ); } + +// PR5514 +int a; +void test2() { ++a+=10; } diff --git a/test/CodeGenCXX/mangle.cpp b/test/CodeGenCXX/mangle.cpp index e8770dfec3e8..5947587eec32 100644 --- a/test/CodeGenCXX/mangle.cpp +++ b/test/CodeGenCXX/mangle.cpp @@ -308,4 +308,9 @@ template class Alloc<char>; } // CHECK: define void @_Z1fU13block_pointerFiiiE -void f(int (^)(int, int)) { }
\ No newline at end of file +void f(int (^)(int, int)) { } + +// PR5869 +// CHECK: define internal void @_ZL2f2v +static void f2() {} +void f3() { f2(); } diff --git a/test/CodeGenCXX/member-function-pointers.cpp b/test/CodeGenCXX/member-function-pointers.cpp index 149b5603ad7c..2454ddab774a 100644 --- a/test/CodeGenCXX/member-function-pointers.cpp +++ b/test/CodeGenCXX/member-function-pointers.cpp @@ -128,3 +128,14 @@ namespace BoolMemberPointer { } } +// PR5940 +namespace PR5940 { + class foo { + public: + virtual void baz(void); + }; + + void foo::baz(void) { + void (foo::*ptr)(void) = &foo::baz; + } +} diff --git a/test/CodeGenCXX/reference-init.cpp b/test/CodeGenCXX/reference-init.cpp index 1bfb28a66a03..6c2c6a301681 100644 --- a/test/CodeGenCXX/reference-init.cpp +++ b/test/CodeGenCXX/reference-init.cpp @@ -7,3 +7,10 @@ struct nsXPTParamInfo { void a(XPTParamDescriptor *params) { const nsXPTParamInfo& paramInfo = params[0]; } + +// CodeGen of reference initialized const arrays. +namespace PR5911 { + template <typename T, int N> int f(const T (&a)[N]) { return N; } + int iarr[] = { 1 }; + int test() { return f(iarr); } +} diff --git a/test/CodeGenCXX/virt.cpp b/test/CodeGenCXX/virt.cpp index 259fd03e7aff..f7f4c9f15c8f 100644 --- a/test/CodeGenCXX/virt.cpp +++ b/test/CodeGenCXX/virt.cpp @@ -153,7 +153,7 @@ void test12_foo() { // CHECK-LPLL64: call void % // CHECK-LPLL64: call void % // CHECK-LPLL64: call void % -// CHECK-LPLL64: call void @_ZN8test12_A3fooEv(%class.test14* %tmp11) +// CHECK-LPLL64: call void @_ZN8test12_A3fooEv(%class.test14* %{{.*}}) struct test6_B2 { virtual void funcB2(); char b[1000]; }; @@ -769,55 +769,53 @@ struct test16_D : test16_NV1, virtual test16_B2 { // FIXME: This is the wrong thunk, but until these issues are fixed, better // than nothing. // CHECK-LPLL64:define weak %class.test8_D* @_ZTcvn16_n72_v16_n32_N8test16_D4foo1Ev(%class.test8_D*) -// CHECK-LPLL64:entry: -// CHECK-LPLL64: %retval = alloca %class.test8_D* +// CHECK-LPLL64: %{{retval|2}} = alloca %class.test8_D* // CHECK-LPLL64: %.addr = alloca %class.test8_D* // CHECK-LPLL64: store %class.test8_D* %0, %class.test8_D** %.addr -// CHECK-LPLL64: %this = load %class.test8_D** %.addr -// CHECK-LPLL64: %1 = bitcast %class.test8_D* %this to i8* -// CHECK-LPLL64: %2 = getelementptr inbounds i8* %1, i64 -16 -// CHECK-LPLL64: %3 = bitcast i8* %2 to %class.test8_D* -// CHECK-LPLL64: %4 = bitcast %class.test8_D* %3 to i8* -// CHECK-LPLL64: %5 = bitcast %class.test8_D* %3 to i64** -// CHECK-LPLL64: %vtable = load i64** %5 -// CHECK-LPLL64: %6 = getelementptr inbounds i64* %vtable, i64 -9 -// CHECK-LPLL64: %7 = load i64* %6 -// CHECK-LPLL64: %8 = getelementptr i8* %4, i64 %7 -// CHECK-LPLL64: %9 = bitcast i8* %8 to %class.test8_D* -// CHECK-LPLL64: %call = call %class.test8_D* @_ZTch0_v16_n32_N8test16_D4foo1Ev(%class.test8_D* %9) -// CHECK-LPLL64: store %class.test8_D* %call, %class.test8_D** %retval -// CHECK-LPLL64: %10 = load %class.test8_D** %retval -// CHECK-LPLL64: ret %class.test8_D* %10 +// CHECK-LPLL64: %{{this|3}} = load %class.test8_D** %.addr +// CHECK-LPLL64: %{{1|4}} = bitcast %class.test8_D* %{{this|3}} to i8* +// CHECK-LPLL64: %{{2|5}} = getelementptr inbounds i8* %{{1|4}}, i64 -16 +// CHECK-LPLL64: %{{3|6}} = bitcast i8* %{{2|5}} to %class.test8_D* +// CHECK-LPLL64: %{{4|7}} = bitcast %class.test8_D* %{{3|6}} to i8* +// CHECK-LPLL64: %{{5|8}} = bitcast %class.test8_D* %3 to i64** +// CHECK-LPLL64: %{{vtable|9}} = load i64** %{{5|8}} +// CHECK-LPLL64: %{{6|10}} = getelementptr inbounds i64* %{{vtable|9}}, i64 -9 +// CHECK-LPLL64: %{{7|11}} = load i64* %{{6|10}} +// CHECK-LPLL64: %{{8|12}} = getelementptr i8* %{{4|7}}, i64 %{{7|11}} +// CHECK-LPLL64: %{{9|13}} = bitcast i8* %{{8|12}} to %class.test8_D* +// CHECK-LPLL64: %{{call|14}} = call %class.test8_D* @_ZTch0_v16_n32_N8test16_D4foo1Ev(%class.test8_D* %{{9|13}}) +// CHECK-LPLL64: store %class.test8_D* %{{call|14}}, %class.test8_D** %{{retval|2}} +// CHECK-LPLL64: %{{10|15}} = load %class.test8_D** %{{retval|2}} +// CHECK-LPLL64: ret %class.test8_D* %{{10|15}} // CHECK-LPLL64:} -// CHECK-LPLL64:define weak %class.test8_D* @_ZTch0_v16_n32_N8test16_D4foo1Ev(%class.test8_D*) -// CHECK-LPLL64:entry: -// CHECK-LPLL64: %retval = alloca %class.test8_D* +// CHECK-LPLL64:define weak %class.test8_D* @_ZTch0_v16_n32_N8test16_D4foo1Ev(%{{class.test8_D|.*}}*) +// CHECK-LPLL64: %{{retval|2}} = alloca %class.test8_D* // CHECK-LPLL64: %.addr = alloca %class.test8_D* // CHECK-LPLL64: store %class.test8_D* %0, %class.test8_D** %.addr -// CHECK-LPLL64: %this = load %class.test8_D** %.addr -// CHECK-LPLL64: %call = call %class.test8_D* @_ZN8test16_D4foo1Ev(%class.test8_D* %this) -// CHECK-LPLL64: %1 = icmp ne %class.test8_D* %call, null -// CHECK-LPLL64: br i1 %1, label %2, label %12 -// CHECK-LPLL64:; <label>:2 -// CHECK-LPLL64: %3 = bitcast %class.test8_D* %call to i8* -// CHECK-LPLL64: %4 = getelementptr inbounds i8* %3, i64 16 -// CHECK-LPLL64: %5 = bitcast i8* %4 to %class.test8_D* -// CHECK-LPLL64: %6 = bitcast %class.test8_D* %5 to i8* -// CHECK-LPLL64: %7 = bitcast %class.test8_D* %5 to i64** -// CHECK-LPLL64: %vtable = load i64** %7 -// CHECK-LPLL64: %8 = getelementptr inbounds i64* %vtable, i64 -4 -// CHECK-LPLL64: %9 = load i64* %8 -// CHECK-LPLL64: %10 = getelementptr i8* %6, i64 %9 -// CHECK-LPLL64: %11 = bitcast i8* %10 to %class.test8_D* -// CHECK-LPLL64: br label %13 -// CHECK-LPLL64:; <label>:12 -// CHECK-LPLL64: br label %13 -// CHECK-LPLL64:; <label>:13 -// CHECK-LPLL64: %14 = phi %class.test8_D* [ %11, %2 ], [ %call, %12 ] -// CHECK-LPLL64: store %class.test8_D* %14, %class.test8_D** %retval -// CHECK-LPLL64: %15 = load %class.test8_D** %retval -// CHECK-LPLL64: ret %class.test8_D* %15 +// CHECK-LPLL64: %{{this|3}} = load %class.test8_D** %.addr +// CHECK-LPLL64: %{{call|4}} = call %class.test8_D* @_ZN8test16_D4foo1Ev(%class.test8_D* %{{this|3}}) +// CHECK-LPLL64: %{{1|5}} = icmp ne %class.test8_D* %{{call|4}}, null +// CHECK-LPLL64: br i1 %{{1|5}}, label %{{2|6}}, label %{{12|17}} +// CHECK-LPLL64:; <label>:{{2|6}} +// CHECK-LPLL64: %{{3|7}} = bitcast %class.test8_D* %{{call|4}} to i8* +// CHECK-LPLL64: %{{4|8}} = getelementptr inbounds i8* %{{3|7}}, i64 16 +// CHECK-LPLL64: %{{5|9}} = bitcast i8* %4 to %class.test8_D* +// CHECK-LPLL64: %{{6|10}} = bitcast %class.test8_D* %{{5|9}} to i8* +// CHECK-LPLL64: %{{7|11}} = bitcast %class.test8_D* %{{5|9}} to i64** +// CHECK-LPLL64: %{{vtable|12}} = load i64** %{{7|11}} +// CHECK-LPLL64: %{{8|13}} = getelementptr inbounds i64* %vtable, i64 -4 +// CHECK-LPLL64: %{{9|14}} = load i64* %{{8|13}} +// CHECK-LPLL64: %{{10|15}} = getelementptr i8* %{{6|10}}, i64 %{{9|14}} +// CHECK-LPLL64: %{{11|16}} = bitcast i8* %{{10|15}} to %class.test8_D* +// CHECK-LPLL64: br label %{{13|18}} +// CHECK-LPLL64:; <label>:{{12|17}} +// CHECK-LPLL64: br label %{{13|18}} +// CHECK-LPLL64:; <label>:{{13|18}} +// CHECK-LPLL64: %{{14|19}} = phi %class.test8_D* [ %{{11|16}}, %{{2|6}} ], [ %{{call|4}}, %{{12|17}} ] +// CHECK-LPLL64: store %class.test8_D* %{{14|19}}, %class.test8_D** %{{retval|2}} +// CHECK-LPLL64: %{{15|20}} = load %class.test8_D** %{{retval|2}} +// CHECK-LPLL64: ret %class.test8_D* %{{15|20}} // CHECK-LPLL64:} diff --git a/test/CodeGenCXX/virtual-destructor-calls.cpp b/test/CodeGenCXX/virtual-destructor-calls.cpp index ecfcad232029..01ca1442f2c4 100644 --- a/test/CodeGenCXX/virtual-destructor-calls.cpp +++ b/test/CodeGenCXX/virtual-destructor-calls.cpp @@ -8,15 +8,15 @@ struct B : A { virtual ~B(); }; +// Complete dtor. +// CHECK: define void @_ZN1BD1Ev +// CHECK: call void @_ZN1AD2Ev + // Deleting dtor. // CHECK: define void @_ZN1BD0Ev // CHECK: call void @_ZN1AD2Ev // check: call void @_ZdlPv -// Complete dtor. -// CHECK: define void @_ZN1BD1Ev -// CHECK: call void @_ZN1AD2Ev - // Base dtor. // CHECK: define void @_ZN1BD2Ev // CHECK: call void @_ZN1AD2Ev diff --git a/test/CodeGenCXX/vtable-key-function.cpp b/test/CodeGenCXX/vtable-key-function.cpp index 90e8ea66f769..97a546f8c932 100644 --- a/test/CodeGenCXX/vtable-key-function.cpp +++ b/test/CodeGenCXX/vtable-key-function.cpp @@ -13,3 +13,21 @@ struct A { A::A() { } A::A(int) { } } + +// Make sure that we don't assert when building the vtable for a class +// template specialization or explicit instantiation with a key +// function. +template<typename T> +struct Base { + virtual ~Base(); +}; + +template<typename T> +struct Derived : public Base<T> { }; + +template<> +struct Derived<char> : public Base<char> { + virtual void anchor(); +}; + +void Derived<char>::anchor() { } diff --git a/test/CodeGenCXX/vtable-linkage.cpp b/test/CodeGenCXX/vtable-linkage.cpp index 6d3cf240096b..63e17431c467 100644 --- a/test/CodeGenCXX/vtable-linkage.cpp +++ b/test/CodeGenCXX/vtable-linkage.cpp @@ -30,6 +30,55 @@ void D::f() { } static struct : D { } e; +// The destructor is the key function. +template<typename T> +struct E { + virtual ~E(); +}; + +template<typename T> E<T>::~E() { } + +// Anchor is the key function +template<> +struct E<char> { + virtual void anchor(); +}; + +void E<char>::anchor() { } + +template struct E<short>; +extern template struct E<int>; + +void use_E() { + E<int> ei; + (void)ei; + E<long> el; + (void)el; +} + +// No key function +template<typename T> +struct F { + virtual void foo() { } +}; + +// No key function +template<> +struct F<char> { + virtual void foo() { } +}; + +template struct F<short>; +extern template struct F<int>; + +void use_F(F<char> &fc) { + F<int> fi; + (void)fi; + F<long> fl; + (void)fl; + fc.foo(); +} + // B has a key function that is not defined in this translation unit so its vtable // has external linkage. // CHECK: @_ZTV1B = external constant @@ -45,6 +94,50 @@ static struct : D { } e; // CHECK: @_ZTI1D = constant // CHECK: @_ZTV1D = constant +// E<char> is an explicit specialization with a key function defined +// in this translation unit, so its vtable should have external +// linkage. +// CHECK: @_ZTS1EIcE = constant +// CHECK: @_ZTI1EIcE = constant +// CHECK: @_ZTV1EIcE = constant + +// E<short> is an explicit template instantiation with a key function +// defined in this translation unit, so its vtable should have +// weak_odr linkage. +// CHECK: @_ZTS1EIsE = weak_odr constant +// CHECK: @_ZTI1EIsE = weak_odr constant +// CHECK: @_ZTV1EIsE = weak_odr constant + +// F<short> is an explicit template instantiation without a key +// function, so its vtable should have weak_odr linkage +// CHECK: @_ZTS1FIsE = weak_odr constant +// CHECK: @_ZTI1FIsE = weak_odr constant +// CHECK: @_ZTV1FIsE = weak_odr constant + +// E<long> is an implicit template instantiation with a key function +// defined in this translation unit, so its vtable should have +// weak_odr linkage. +// CHECK: @_ZTS1EIlE = weak_odr constant +// CHECK: @_ZTI1EIlE = weak_odr constant +// CHECK: @_ZTV1EIlE = weak_odr constant + +// F<long> is an implicit template instantiation with no key function, +// so its vtable should have weak_odr linkage. +// CHECK: @_ZTS1FIlE = weak_odr constant +// CHECK: @_ZTI1FIlE = weak_odr constant +// CHECK: @_ZTV1FIlE = weak_odr constant + +// F<int> is an explicit template instantiation declaration without a +// key function, so its vtable should have weak_odr linkage. +// CHECK: @_ZTS1FIiE = weak_odr constant +// CHECK: @_ZTI1FIiE = weak_odr constant +// CHECK: @_ZTV1FIiE = weak_odr constant + +// E<int> is an explicit template instantiation declaration. It has a +// key function that is not instantiated, so we should only reference +// its vtable, not define it. +// CHECK: @_ZTV1EIiE = external constant + // The anonymous struct for e has no linkage, so the vtable should have // internal linkage. // CHECK: @"_ZTS3$_0" = internal constant @@ -56,3 +149,5 @@ static struct : D { } e; // CHECK: @_ZTSN12_GLOBAL__N_11AE = internal constant // CHECK: @_ZTIN12_GLOBAL__N_11AE = internal constant // CHECK: @_ZTVN12_GLOBAL__N_11AE = internal constant + + |
