diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2009-10-14 18:03:49 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2009-10-14 18:03:49 +0000 |
commit | 9092c3e0fa01f3139b016d05d267a89e3b07747a (patch) | |
tree | 137ebebcae16fb0ce7ab4af456992bbd8d22fced /test/CodeGenCXX/predefined-expr-sizeof.cpp | |
parent | 4981926bf654fe5a2c3893f24ca44106b217e71e (diff) | |
download | FreeBSD-src-9092c3e0fa01f3139b016d05d267a89e3b07747a.zip FreeBSD-src-9092c3e0fa01f3139b016d05d267a89e3b07747a.tar.gz |
Update clang to r84119.
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 0000000..e318fbe --- /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; +} |