diff options
author | Roman Divacky <rdivacky@FreeBSD.org> | 2009-10-14 18:03:49 +0000 |
---|---|---|
committer | Roman Divacky <rdivacky@FreeBSD.org> | 2009-10-14 18:03:49 +0000 |
commit | 4c8b24812ddcd1dedaca343a6d4e76f91f398981 (patch) | |
tree | 137ebebcae16fb0ce7ab4af456992bbd8d22fced /test/CodeGenCXX/predefined-expr-sizeof.cpp | |
parent | 5362a71c02e7d448a8ce98cf00c47e353fba5d04 (diff) |
Notes
Diffstat (limited to 'test/CodeGenCXX/predefined-expr-sizeof.cpp')
-rw-r--r-- | test/CodeGenCXX/predefined-expr-sizeof.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/CodeGenCXX/predefined-expr-sizeof.cpp b/test/CodeGenCXX/predefined-expr-sizeof.cpp new file mode 100644 index 0000000000000..e318fbec18ae3 --- /dev/null +++ b/test/CodeGenCXX/predefined-expr-sizeof.cpp @@ -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; +} |