Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Modules / redundant-template-default-arg.cpp
blob6807b45e513954c9daf93955b1f3bbfb4055a1c8
1 // RUN: rm -rf %t
2 // RUN: mkdir %t
3 // RUN: split-file %s %t
4 //
5 // RUN: %clang_cc1 -std=c++20 %t/foo.cppm -I%t -emit-module-interface -o %t/foo.pcm
6 // RUN: %clang_cc1 -fprebuilt-module-path=%t -std=c++20 %t/use.cpp -I%t -fsyntax-only -verify
8 //--- foo.h
9 template <typename T>
10 T u;
12 template <typename T = int>
13 T v;
15 template <int T = 8>
16 int v2;
18 template <typename T>
19 class my_array {};
21 template <template <typename> typename C = my_array>
22 int v3;
24 template <typename T, int *i = nullptr>
25 T v4;
27 template <typename T, T *i = nullptr>
28 T v5;
30 inline int a = 43;
31 template <typename T, int *i = &a>
32 T v6;
34 inline int b = 43;
35 template <typename T, T *i = &b>
36 T v7;
38 template <int T = (3 > 2)>
39 int v8;
41 consteval int getInt() {
42 return 55;
44 template <int T = getInt()>
45 int v9;
47 //--- foo.cppm
48 module;
49 #include "foo.h"
50 export module foo;
53 //--- use.cpp
54 // expected-no-diagnostics
55 import foo;
56 #include "foo.h"