brintos

brintos / llvm-project-archived public Read only

0
0
Text · 639 B · 7e7f220 Raw
36 lines · cpp
1// RUN: %clang_cc1 -std=c++20 -mllvm -emptyline-comment-coverage=false -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name templates.cpp %s | FileCheck %s2 3template<typename T>4void unused(T x) {5  return;6}7 8template<typename T>9int func(T x) {  // CHECK: func10  if(x)          // CHECK: func11    return 0;12  else13    return 1;14  int j = 1;15}16 17int main() {18  func<int>(0);19  func<bool>(true);20  return 0;21}22 23namespace structural_value_crash {24  template <int* p>25  void tpl_fn() {26    (void)p;27  }28 29  int arr[] = {1, 2, 3};30 31  void test() {32    tpl_fn<arr>();33    tpl_fn<&arr[1]>();34  }35}36