[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / CodeGenCXX / attr-used.cpp
blobd2a73f7d33e6cbdf3ce926ffbf768aeac05619d5
1 // RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -o - %s | FileCheck %s
3 // <rdar://problem/8684363>: clang++ not respecting __attribute__((used)) on destructors
4 struct X0 {
5 // CHECK-DAG: define linkonce_odr {{.*}} @_ZN2X0C1Ev
6 __attribute__((used)) X0() {}
7 // CHECK-DAG: define linkonce_odr {{.*}} @_ZN2X0D1Ev
8 __attribute__((used)) ~X0() {}
9 };
11 // PR19743: not emitting __attribute__((used)) inline methods in nested classes.
12 struct X1 {
13 struct Nested {
14 // CHECK-DAG: define linkonce_odr {{.*}} @_ZN2X16Nested1fEv
15 void __attribute__((used)) f() {}
19 struct X2 {
20 // We must delay emission of bar() until foo() has had its body parsed,
21 // otherwise foo() would not be emitted.
22 void __attribute__((used)) bar() { foo(); }
23 void foo() { }
25 // CHECK-DAG: define linkonce_odr {{.*}} @_ZN2X23barEv
26 // CHECK-DAG: define linkonce_odr {{.*}} @_ZN2X23fooEv