mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-05-13 17:37:00 +00:00

This returns (probably temporarily) array-referring NTTP behavior to which was prior to #78041 because ~~I'm fed up~~ have no time to fix regressions. (cherry picked from commit 9bf4e54ef42d907ae7550f36fa518f14fa97af6f)
35 lines
605 B
C++
35 lines
605 B
C++
// RUN: %clang_cc1 -mllvm -emptyline-comment-coverage=false -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name templates.cpp %s | FileCheck %s
|
|
|
|
template<typename T>
|
|
void unused(T x) {
|
|
return;
|
|
}
|
|
|
|
template<typename T>
|
|
int func(T x) { // CHECK: func
|
|
if(x) // CHECK: func
|
|
return 0;
|
|
else
|
|
return 1;
|
|
int j = 1;
|
|
}
|
|
|
|
int main() {
|
|
func<int>(0);
|
|
func<bool>(true);
|
|
return 0;
|
|
}
|
|
|
|
namespace structural_value_crash {
|
|
template <int* p>
|
|
void tpl_fn() {
|
|
(void)p;
|
|
}
|
|
|
|
int arr[] = {1, 2, 3};
|
|
|
|
void test() {
|
|
tpl_fn<arr>();
|
|
}
|
|
}
|