Add a test exposing an issue with the unloading of inlined functions coming from a pch/pcm.
This commit is contained in:
parent
f3e4d96ffc
commit
a8ccf3468c
18
test/CodeUnloading/PCH/Inlines.C
Normal file
18
test/CodeUnloading/PCH/Inlines.C
Normal 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
|
9
test/CodeUnloading/PCH/Inputs/Inlines.h
Normal file
9
test/CodeUnloading/PCH/Inputs/Inlines.h
Normal 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
|
Loading…
x
Reference in New Issue
Block a user