brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · 2df39e1 Raw
61 lines · cpp
1// RUN: dsymutil -f -oso-prepend-path=%p/../Inputs/modules-pruning \2// RUN:   -verify \3// RUN:   -y %p/dummy-debug-map.map -o - \4// RUN:     | llvm-dwarfdump --name isRef -p - | FileCheck %s5 6/* Compile with:7   cat >modules.modulemap <<EOF8   module Outer {9     module Template {10       header "template.h"11       export *12     }13   }14EOF15   clang++ -D TEMPLATE_H -E -o template.h modules-pruning.cpp16   clang++ -c -fcxx-modules -fmodules -fmodule-map-file=modules.modulemap \17     -g -gmodules -fmodules-cache-path=. \18     -Xclang -fdisable-module-hash modules-pruning.cpp -o 1.o19*/20 21// CHECK: DW_TAG_compile_unit22// CHECK:   DW_TAG_module23// CHECK:     DW_TAG_module24// CHECK:       DW_TAG_class25// CHECK:         DW_TAG_member26// CHECK:           DW_AT_name ("isRef")27// CHECK:           DW_AT_declaration (true)28// CHECK:           DW_AT_const_value (1)29// CHECK-NOT: DW_TAG30 31#ifdef TEMPLATE_H32 33namespace M {34struct false_type {35  static const bool value = false;36};37struct true_type {38  static const bool value = true;39};40 41template <class T> struct is_reference      : false_type {};42template <class T> struct is_reference<T&>  : true_type {};43 44template<class T>45class Template {46public:47  static const bool isRef = is_reference<T>::value;48  Template() {}49};50}51#else52 53#include "template.h"54 55void foo() {56  M::Template<bool&> TB1;57  TB1.isRef;58}59 60#endif61