50 lines · cpp
1// REQUIRES: asserts2// RUN: %clang_cc1 -O0 -triple %itanium_abi_triple -debug-info-kind=limited -emit-llvm %s -o - | \3// RUN: FileCheck %s4 5// Trigger GenerateVarArgsThunk.6// RUN: %clang_cc1 -O0 -triple riscv64-linux-gnu -debug-info-kind=limited -emit-llvm %s -o - | \7// RUN: FileCheck %s8 9// Check that retainedNodes are properly maintained at function cloning.10// RUN: %clang_cc1 -O1 -triple riscv64-linux-gnu -debug-info-kind=limited -emit-llvm %s -o - | \11// RUN: FileCheck %s --check-prefixes=CHECK,CHECK-DI12 13// This test simply checks that the varargs thunk is created. The failing test14// case asserts.15 16typedef signed char __int8_t;17typedef int BOOL;18class CMsgAgent;19 20class CFs {21public:22 typedef enum {} CACHE_HINT;23 virtual BOOL ReqCacheHint( CMsgAgent* p_ma, CACHE_HINT hint, ... ) ;24};25 26typedef struct {} _Lldiv_t;27 28class CBdVfs {29public:30 virtual ~CBdVfs( ) {}31};32 33class CBdVfsImpl : public CBdVfs, public CFs {34 BOOL ReqCacheHint( CMsgAgent* p_ma, CACHE_HINT hint, ... );35};36 37BOOL CBdVfsImpl::ReqCacheHint( CMsgAgent* p_ma, CACHE_HINT hint, ... ) {38 return true;39}40 41// CHECK: define {{.*}} @_ZThn{{[48]}}_N10CBdVfsImpl12ReqCacheHintEP9CMsgAgentN3CFs10CACHE_HINTEz(42 43// An empty retainedNodes list of cloned DISubprogram.44// CHECK-DI: [[EMPTY:![0-9]+]] = !{}45// CHECK-DI: distinct !DISubprogram({{.*}}, linkageName: "_ZN10CBdVfsImpl12ReqCacheHintEP9CMsgAgentN3CFs10CACHE_HINTEz", {{.*}}, retainedNodes: [[RN1:![0-9]+]]46// A non-empty retainedNodes list of original DISubprogram.47// CHECK-DI: [[RN1]] = !{!{{.*}}}48 49// CHECK-DI: distinct !DISubprogram({{.*}}, linkageName: "_ZN10CBdVfsImpl12ReqCacheHintEP9CMsgAgentN3CFs10CACHE_HINTEz", {{.*}}, retainedNodes: [[EMPTY]]50