1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm %s -o %t
2f4a2713aSLionel Sambuc
3f4a2713aSLionel Sambuc // Note-LABEL: define CLANG_GENERATE_KNOWN_GOOD and compile to generate code
4f4a2713aSLionel Sambuc // that makes all of the defaulted arguments explicit. The resulting
5f4a2713aSLionel Sambuc // byte code should be identical to the compilation without
6f4a2713aSLionel Sambuc // CLANG_GENERATE_KNOWN_GOOD.
7f4a2713aSLionel Sambuc #ifdef CLANG_GENERATE_KNOWN_GOOD
8f4a2713aSLionel Sambuc # define DEFARG(...) __VA_ARGS__
9f4a2713aSLionel Sambuc #else
10f4a2713aSLionel Sambuc # define DEFARG(...)
11f4a2713aSLionel Sambuc #endif
12f4a2713aSLionel Sambuc
13f4a2713aSLionel Sambuc extern int x;
14f4a2713aSLionel Sambuc struct S { float x; float y; } s;
15f4a2713aSLionel Sambuc double _Complex c;
16f4a2713aSLionel Sambuc
17f4a2713aSLionel Sambuc void f(int i = 0, int j = 1, int k = x, struct S t = s, double _Complex d = c);
18f4a2713aSLionel Sambuc
g()19f4a2713aSLionel Sambuc void g() {
20f4a2713aSLionel Sambuc f(0, 1, x, s DEFARG(, c));
21f4a2713aSLionel Sambuc f(0, 1, x DEFARG(, s, c));
22f4a2713aSLionel Sambuc f(0, 1 DEFARG(, x, s, c));
23f4a2713aSLionel Sambuc f(0 DEFARG(, 1, x, s, c));
24f4a2713aSLionel Sambuc f(DEFARG(0, 1, x, s, c));
25f4a2713aSLionel Sambuc }
26