summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CodeGenCXX/member-pointer-type-convert.cpp1
-rw-r--r--clang/test/CodeGenCXX/pointers-to-data-members.cpp9
-rw-r--r--clang/test/CodeGenCXX/visibility.cpp33
-rw-r--r--clang/test/Index/index-templates.cpp2
4 files changed, 41 insertions, 4 deletions
diff --git a/clang/test/CodeGenCXX/member-pointer-type-convert.cpp b/clang/test/CodeGenCXX/member-pointer-type-convert.cpp
index 16c14692f66..2970a2e39e3 100644
--- a/clang/test/CodeGenCXX/member-pointer-type-convert.cpp
+++ b/clang/test/CodeGenCXX/member-pointer-type-convert.cpp
@@ -6,5 +6,6 @@ struct {
const char *name;
param_t par;
} *ptr;
+void test_ptr() { (void) ptr; } // forced use
// CHECK: type { i8*, {{i..}} }
diff --git a/clang/test/CodeGenCXX/pointers-to-data-members.cpp b/clang/test/CodeGenCXX/pointers-to-data-members.cpp
index 38c7d2815a0..b2deb313287 100644
--- a/clang/test/CodeGenCXX/pointers-to-data-members.cpp
+++ b/clang/test/CodeGenCXX/pointers-to-data-members.cpp
@@ -18,23 +18,26 @@ namespace ZeroInit {
// CHECK: @_ZN8ZeroInit1bE = global i64 -1,
int A::* b = 0;
- // CHECK: @_ZN8ZeroInit2saE = global %struct.anon { i64 -1 }
+ // CHECK: @_ZN8ZeroInit2saE = internal global %struct.anon { i64 -1 }
struct {
int A::*a;
} sa;
+ void test_sa() { (void) sa; } // force emission
- // CHECK: @_ZN8ZeroInit3ssaE =
+ // CHECK: @_ZN8ZeroInit3ssaE = internal
// CHECK: [2 x i64] [i64 -1, i64 -1]
struct {
int A::*aa[2];
} ssa[2];
+ void test_ssa() { (void) ssa; }
- // CHECK: @_ZN8ZeroInit2ssE = global %1 { %struct.anon { i64 -1 } }
+ // CHECK: @_ZN8ZeroInit2ssE = internal global %1 { %struct.anon { i64 -1 } }
struct {
struct {
int A::*pa;
} s;
} ss;
+ void test_ss() { (void) ss; }
struct A {
int A::*a;
diff --git a/clang/test/CodeGenCXX/visibility.cpp b/clang/test/CodeGenCXX/visibility.cpp
index ee3c1795fbb..0eb075c999d 100644
--- a/clang/test/CodeGenCXX/visibility.cpp
+++ b/clang/test/CodeGenCXX/visibility.cpp
@@ -1,11 +1,15 @@
// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -fvisibility hidden -emit-llvm -o - | FileCheck %s -check-prefix=CHECK-HIDDEN
#define HIDDEN __attribute__((visibility("hidden")))
#define PROTECTED __attribute__((visibility("protected")))
#define DEFAULT __attribute__((visibility("default")))
// CHECK: @_ZN5Test425VariableInHiddenNamespaceE = hidden global i32 10
+// CHECK: @_ZN5Test71aE = hidden global
+// CHECK: @_ZN5Test71bE = global
// CHECK: @_ZTVN5Test63fooE = weak_odr hidden constant
+
namespace Test1 {
// CHECK: define hidden void @_ZN5Test11fEv
void HIDDEN f() { }
@@ -82,3 +86,32 @@ namespace Test6 {
barc::barc() {}
}
+
+namespace Test7 {
+ class HIDDEN A {};
+ A a; // top of file
+
+ template <A&> struct Aref {
+ static void foo() {}
+ };
+
+ class B : public A {};
+ B b; // top of file
+
+ // CHECK: define linkonce_odr hidden void @_ZN5Test74ArefILZNS_1aEEE3fooEv()
+ void test() {
+ Aref<a>::foo();
+ }
+}
+
+namespace Test8 {
+ void foo();
+ void bar() {}
+ // CHECK-HIDDEN: define hidden void @_ZN5Test83barEv()
+ // CHECK-HIDDEN: declare void @_ZN5Test83fooEv()
+
+ void test() {
+ foo();
+ bar();
+ }
+}
diff --git a/clang/test/Index/index-templates.cpp b/clang/test/Index/index-templates.cpp
index b657c17fafc..7d78b4a256f 100644
--- a/clang/test/Index/index-templates.cpp
+++ b/clang/test/Index/index-templates.cpp
@@ -192,7 +192,7 @@ struct SuperPair : Pair<int, int>, Pair<T, U> { };
// CHECK-USRS: index-templates.cpp c:index-templates.cpp@210 Extent=[8:19 - 8:20]
// CHECK-USRS: index-templates.cpp c:index-templates.cpp@222 Extent=[8:31 - 8:36]
// CHECK-USRS: index-templates.cpp c:@CT>2#T#T@vector@F@clear# Extent=[10:8 - 10:15]
-// CHECK-USRS: index-templates.cpp c:index-templates.cpp@280@CP>1#T@vector>#*t0.0#>@CT>1#T@allocator1S0_ Extent=[13:1 - 14:21]
+// CHECK-USRS: index-templates.cpp c:@CP>1#T@vector>#*t0.0#>@CT>1#T@allocator1S0_ Extent=[13:1 - 14:21]
// CHECK-USRS: index-templates.cpp c:index-templates.cpp@298 Extent=[13:19 - 13:20]
// CHECK-USRS: index-templates.cpp c:@S@Z1 Extent=[16:1 - 16:14]
// CHECK-USRS: index-templates.cpp c:@C@vector>#$@S@Z1#$@C@allocator>#S0_ Extent=[18:1 - 18:22]
OpenPOWER on IntegriCloud