diff options
author | John McCall <rjmccall@apple.com> | 2010-08-12 07:31:42 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-08-12 07:31:42 +0000 |
commit | 6d311229f0b894f6a8acda2d78f06a4198b487b7 (patch) | |
tree | efedeced314a46f23c59d6abd7e2cf17ab15a454 /test/CodeGenCXX/global-init.cpp | |
parent | 7b49202090678f45fa0c0bb5fa560d8a27b0c604 (diff) |
Test for rdar://problem/8073696.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110907 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/global-init.cpp')
-rw-r--r-- | test/CodeGenCXX/global-init.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/CodeGenCXX/global-init.cpp b/test/CodeGenCXX/global-init.cpp index 210f2a6969..6ff9598afc 100644 --- a/test/CodeGenCXX/global-init.cpp +++ b/test/CodeGenCXX/global-init.cpp @@ -14,6 +14,9 @@ struct D { ~D(); }; // CHECK: @c = global %struct.C zeroinitializer, align 8 +// It's okay if we ever implement the IR-generation optimization to remove this. +// CHECK: @_ZN5test3L3varE = internal constant i8* getelementptr inbounds ([7 x i8]* + // CHECK: call void @_ZN1AC1Ev(%struct.A* @a) // CHECK: call i32 @__cxa_atexit(void (i8*)* bitcast (void (%struct.A*)* @_ZN1AD1Ev to void (i8*)*), i8* getelementptr inbounds (%struct.A* @a, i32 0, i32 0), i8* bitcast (i8** @__dso_handle to i8*)) A a; @@ -53,6 +56,14 @@ namespace test2 { // CHECK: call i32 @__cxa_atexit({{.*}} @_ZN5test21AD1Ev {{.*}} @_ZN5test21aE } +namespace test3 { + // Tested at the beginning of the file. + const char * const var = "string"; + extern const char * const var; + + const char *test() { return var; } +} + // CHECK: define internal void [[TEST1_Z_INIT:@.*]]() // CHECK: load i32* @_ZN5test1L1yE // CHECK-NEXT: xor |