aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/attr-used.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGenCXX/attr-used.cpp')
-rw-r--r--test/CodeGenCXX/attr-used.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/test/CodeGenCXX/attr-used.cpp b/test/CodeGenCXX/attr-used.cpp
index 2c82184081b9..861734667357 100644
--- a/test/CodeGenCXX/attr-used.cpp
+++ b/test/CodeGenCXX/attr-used.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -o - %s | FileCheck %s
// <rdar://problem/8684363>: clang++ not respecting __attribute__((used)) on destructors
struct X0 {
@@ -7,3 +7,21 @@ struct X0 {
// CHECK: define linkonce_odr {{.*}} @_ZN2X0D1Ev
__attribute__((used)) ~X0() {}
};
+
+// PR19743: not emitting __attribute__((used)) inline methods in nested classes.
+struct X1 {
+ struct Nested {
+ // CHECK: define linkonce_odr {{.*}} @_ZN2X16Nested1fEv
+ void __attribute__((used)) f() {}
+ };
+};
+
+struct X2 {
+ // We must delay emission of bar() until foo() has had its body parsed,
+ // otherwise foo() would not be emitted.
+ void __attribute__((used)) bar() { foo(); }
+ void foo() { }
+
+ // CHECK: define linkonce_odr {{.*}} @_ZN2X23barEv
+ // CHECK: define linkonce_odr {{.*}} @_ZN2X23fooEv
+};