Add a test exposing an issue with the unloading of inlined functions coming from a pch/pcm.

This commit is contained in:
Vassil Vassilev 2014-09-30 17:51:12 +02:00 committed by sftnight
parent f3e4d96ffc
commit a8ccf3468c
2 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,18 @@
// RUN: rm -f Inlines.h.pch
// RUN: clang -cc1 -target-cpu x86-64 -fdeprecated-macro -fmath-errno -fexceptions -fcxx-exceptions -fgnu-keywords -emit-pch -xc++ -std=c++11 %S/Inputs/Inlines.h -o Inlines.h.pch
// RUN: cat %s | %cling -I%p -Xclang -trigraphs -Xclang -include-pch -Xclang Inlines.h.pch 2>&1 | FileCheck %s
//XFAIL:*
#include "Inputs/Inlines.h"
extern "C" int printf(const char*, ...);
CompGen a;
CompGen b = a;
//.storeState "a"
printf("%d %d\n", a.InlineFunc(), b.InlineFunc());
.undo 1
printf("%d %d\n", a.InlineFunc(), b.InlineFunc());
//.compareState "a"
// CHECK: I was executed
// CHECK: I was executed
.q

View File

@ -0,0 +1,9 @@
#ifndef INCLUDE_COMPGEN_H
#define INCLUDE_COMPGEN_H
struct CompGen {
int I;
inline int InlineFunc();
};
int CompGen::InlineFunc() { return 17; }
#endif //INCLUDE_COMPGEN_H