brintos

brintos / llvm-project-archived public Read only

0
0
Text · 713 B · 7688e79 Raw
26 lines · cpp
1// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm %s -o %t2 3// Note-LABEL: define CLANG_GENERATE_KNOWN_GOOD and compile to generate code4// that makes all of the defaulted arguments explicit. The resulting5// byte code should be identical to the compilation without6// CLANG_GENERATE_KNOWN_GOOD.7#ifdef CLANG_GENERATE_KNOWN_GOOD8#  define DEFARG(...) __VA_ARGS__9#else10#  define DEFARG(...)11#endif12 13extern int x;14struct S { float x; float y; } s;15double _Complex c;16 17void f(int i = 0, int j = 1, int k = x, struct S t = s, double _Complex d = c);18 19void g() {20  f(0, 1, x, s DEFARG(, c));21  f(0, 1, x DEFARG(, s, c));22  f(0, 1 DEFARG(, x, s, c));23  f(0 DEFARG(, 1, x, s, c));24  f(DEFARG(0, 1, x, s, c));25}26