[cfe-commits] r110907 - /cfe/trunk/test/CodeGenCXX/global-init.cpp

John McCall rjmccall at apple.com
Thu Aug 12 00:31:42 PDT 2010


Author: rjmccall
Date: Thu Aug 12 02:31:42 2010
New Revision: 110907

URL: http://llvm.org/viewvc/llvm-project?rev=110907&view=rev
Log:
Test for rdar://problem/8073696.


Modified:
    cfe/trunk/test/CodeGenCXX/global-init.cpp

Modified: cfe/trunk/test/CodeGenCXX/global-init.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/global-init.cpp?rev=110907&r1=110906&r2=110907&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/global-init.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/global-init.cpp Thu Aug 12 02:31:42 2010
@@ -14,6 +14,9 @@
 
 // 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 @@
 // 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





More information about the cfe-commits mailing list