diff options
| author | Roman Divacky <rdivacky@FreeBSD.org> | 2010-05-27 15:17:06 +0000 |
|---|---|---|
| committer | Roman Divacky <rdivacky@FreeBSD.org> | 2010-05-27 15:17:06 +0000 |
| commit | d7279c4c177bca357ef96ff1379fd9bc420bfe83 (patch) | |
| tree | 3558f327a6f9ab59c5d7a06528d84e1560445247 /test/CodeGenCXX/static-init.cpp | |
| parent | be17651f5cd2e94922c1b732bc8589e180698193 (diff) | |
Notes
Diffstat (limited to 'test/CodeGenCXX/static-init.cpp')
| -rw-r--r-- | test/CodeGenCXX/static-init.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/test/CodeGenCXX/static-init.cpp b/test/CodeGenCXX/static-init.cpp index 750da02603b3a..9ad87df8f0c36 100644 --- a/test/CodeGenCXX/static-init.cpp +++ b/test/CodeGenCXX/static-init.cpp @@ -2,8 +2,9 @@ // CHECK: @_ZZ1hvE1i = internal global i32 0, align 4 -// CHECK: @_ZZ2h2vE1i = weak global i32 0 -// CHECK: @_ZGVZ2h2vE1i = weak global i64 0 +// CHECK: @_ZZN5test16getvarEiE3var = internal constant [4 x i32] [i32 1, i32 0, i32 2, i32 4], align 4 +// CHECK: @_ZZ2h2vE1i = linkonce_odr global i32 0 +// CHECK: @_ZGVZ2h2vE1i = linkonce_odr global i64 0 struct A { A(); @@ -11,7 +12,9 @@ struct A { }; void f() { - // CHECK: call void @_ZN1AC1Ev( + // CHECK: call i32 @__cxa_guard_acquire + // CHECK: call void @_ZN1AC1Ev + // CHECK: call void @__cxa_guard_release // CHECK: call i32 @__cxa_atexit(void (i8*)* bitcast (void (%struct.A*)* @_ZN1AD1Ev to void (i8*)*), i8* getelementptr inbounds (%struct.A* @_ZZ1fvE1a, i32 0, i32 0), i8* bitcast (i8** @__dso_handle to i8*)) static A a; } @@ -45,3 +48,13 @@ namespace test0 { static A r; } } + +namespace test1 { + // CHECK: define internal i32 @_ZN5test16getvarEi( + static inline int getvar(int index) { + static const int var[] = { 1, 0, 2, 4 }; + return var[index]; + } + + void test() { (void) getvar(2); } +} |
