[cfe-commits] r81550 - /cfe/trunk/test/CodeGenCXX/predefined-expr-sizeof.cpp
Sam Weinig
sam.weinig at gmail.com
Fri Sep 11 11:49:47 PDT 2009
Author: weinig
Date: Fri Sep 11 13:49:46 2009
New Revision: 81550
URL: http://llvm.org/viewvc/llvm-project?rev=81550&view=rev
Log:
Add test for dependent PredefinedExprs.
Added:
cfe/trunk/test/CodeGenCXX/predefined-expr-sizeof.cpp
Added: cfe/trunk/test/CodeGenCXX/predefined-expr-sizeof.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/predefined-expr-sizeof.cpp?rev=81550&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenCXX/predefined-expr-sizeof.cpp (added)
+++ cfe/trunk/test/CodeGenCXX/predefined-expr-sizeof.cpp Fri Sep 11 13:49:46 2009
@@ -0,0 +1,30 @@
+// RUN: clang-cc %s -emit-llvm -o - | FileCheck %s
+
+// CHECK: store i32 49, i32* %size
+// CHECK: store i32 52, i32* %size
+template<typename T>
+class TemplateClass {
+public:
+ void templateClassFunction() {
+ int size = sizeof(__PRETTY_FUNCTION__);
+ }
+};
+
+// CHECK: store i32 27, i32* %size
+// CHECK: store i32 30, i32* %size
+template<typename T>
+void functionTemplate(T t) {
+ int size = sizeof(__PRETTY_FUNCTION__);
+}
+
+int main() {
+ TemplateClass<int> t1;
+ t1.templateClassFunction();
+ TemplateClass<double> t2;
+ t2.templateClassFunction();
+
+ functionTemplate<int>(0);
+ functionTemplate(0.0);
+
+ return 0;
+}
More information about the cfe-commits
mailing list