1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -o - %s | FileCheck %s 2*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -o - %s -O1 | FileCheck %s --check-prefix=O1 3*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple %ms_abi_triple -emit-llvm -o - %s | FileCheck %s 4*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple %ms_abi_triple -emit-llvm -o - %s -O1 | FileCheck %s --check-prefix=O1 5*0a6a1f1dSLionel Sambuc 6*0a6a1f1dSLionel Sambuc // Check that GlobalOpt can eliminate static constructors for simple implicit 7*0a6a1f1dSLionel Sambuc // constructors. This is a targetted integration test to make sure that LLVM's 8*0a6a1f1dSLionel Sambuc // optimizers are able to process Clang's IR. GlobalOpt in particular is 9*0a6a1f1dSLionel Sambuc // sensitive to the casts we emit. 10*0a6a1f1dSLionel Sambuc 11*0a6a1f1dSLionel Sambuc // CHECK: @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] 12*0a6a1f1dSLionel Sambuc // CHECK: [{ i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__sub_I_ctor_globalopt.cpp, i8* null }] 13*0a6a1f1dSLionel Sambuc 14*0a6a1f1dSLionel Sambuc // CHECK-LABEL: define internal void @_GLOBAL__sub_I_ctor_globalopt.cpp() 15*0a6a1f1dSLionel Sambuc // CHECK: call void @ 16*0a6a1f1dSLionel Sambuc // CHECK-NOT: call 17*0a6a1f1dSLionel Sambuc 18*0a6a1f1dSLionel Sambuc // O1: @llvm.global_ctors = appending global [0 x { i32, void ()*, i8* }] zeroinitializer 19*0a6a1f1dSLionel Sambuc 20*0a6a1f1dSLionel Sambuc struct A { 21*0a6a1f1dSLionel Sambuc virtual void f(); 22*0a6a1f1dSLionel Sambuc int a; 23*0a6a1f1dSLionel Sambuc }; 24*0a6a1f1dSLionel Sambuc struct B : virtual A { 25*0a6a1f1dSLionel Sambuc virtual void g(); 26*0a6a1f1dSLionel Sambuc int b; 27*0a6a1f1dSLionel Sambuc }; 28*0a6a1f1dSLionel Sambuc B b; 29