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