[llvm-commits] CVS: llvm/test/Regression/C++Frontend/2005-01-03-StaticInitializers.cpp
Chris Lattner
lattner at cs.uiuc.edu
Mon Jan 3 14:28:10 PST 2005
Changes in directory llvm/test/Regression/C++Frontend:
2005-01-03-StaticInitializers.cpp added (r1.1)
---
Log message:
Add a testcase to check that initializer that CAN be evaluated statically ARE.
These used to result in dynamic initializations.
---
Diffs of the changes: (+8 -0)
Index: llvm/test/Regression/C++Frontend/2005-01-03-StaticInitializers.cpp
diff -c /dev/null llvm/test/Regression/C++Frontend/2005-01-03-StaticInitializers.cpp:1.1
*** /dev/null Mon Jan 3 16:28:08 2005
--- llvm/test/Regression/C++Frontend/2005-01-03-StaticInitializers.cpp Mon Jan 3 16:27:58 2005
***************
*** 0 ****
--- 1,8 ----
+ // RUN: %llvmgxx %s -S -o - | grep '%XX = global int 4'
+
+ struct S {
+ int A[2];
+ };
+
+ int XX = (int)&(((struct S*)0)->A[1]);
+
More information about the llvm-commits
mailing list