YouCompleteMe/cpp/llvm/tools/clang/test/CodeGenCXX/predefined-expr-sizeof.cpp
Strahinja Val Markovic 1f51a89d39 Adding more llvm/clang files
These were ignored by git accidentally. We want ALL OF THEM since they all came
in the llvm/clang source distribution.
2012-07-05 17:55:45 -07:00

31 lines
620 B
C++

// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
// CHECK: store i32 59, i32* %size
// CHECK: store i32 65, i32* %size
template<typename T>
class TemplateClass {
public:
void templateClassFunction() {
int size = sizeof(__PRETTY_FUNCTION__);
}
};
// CHECK: store i32 35, i32* %size
// CHECK: store i32 38, 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;
}