opnsense-src/test/CodeGenCXX/predefined-expr-sizeof.cpp

31 lines
620 B
C++
Raw Normal View History

2010-01-01 05:34:51 -05:00
// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
2009-10-14 14:03:49 -04:00
// 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;
}