Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s |
Sam Weinig | d5d6778 | 2009-09-11 18:49:46 +0000 | [diff] [blame] | 2 | |
Douglas Gregor | abf65ce | 2012-04-10 20:14:15 +0000 | [diff] [blame] | 3 | // CHECK: store i32 59, i32* %size |
| 4 | // CHECK: store i32 65, i32* %size |
Sam Weinig | d5d6778 | 2009-09-11 18:49:46 +0000 | [diff] [blame] | 5 | template<typename T> |
| 6 | class TemplateClass { |
| 7 | public: |
| 8 | void templateClassFunction() { |
| 9 | int size = sizeof(__PRETTY_FUNCTION__); |
| 10 | } |
| 11 | }; |
| 12 | |
Douglas Gregor | abf65ce | 2012-04-10 20:14:15 +0000 | [diff] [blame] | 13 | // CHECK: store i32 35, i32* %size |
| 14 | // CHECK: store i32 38, i32* %size |
Sam Weinig | d5d6778 | 2009-09-11 18:49:46 +0000 | [diff] [blame] | 15 | template<typename T> |
| 16 | void functionTemplate(T t) { |
| 17 | int size = sizeof(__PRETTY_FUNCTION__); |
| 18 | } |
| 19 | |
| 20 | int main() { |
| 21 | TemplateClass<int> t1; |
| 22 | t1.templateClassFunction(); |
| 23 | TemplateClass<double> t2; |
| 24 | t2.templateClassFunction(); |
| 25 | |
| 26 | functionTemplate<int>(0); |
| 27 | functionTemplate(0.0); |
| 28 | |
| 29 | return 0; |
| 30 | } |