gcc/testsuite/gdc.test/runnable/test9495.d
raw| 1 | // PERMUTE_ARGS: |
| 2 | |
| 3 | import core.vararg; |
| 4 | |
| 5 | int func1(int a, ...) |
| 6 | { |
| 7 | auto result = va_arg!int(_argptr); |
| 8 | return result; |
| 9 | } |
| 10 | |
| 11 | void test9495a() |
| 12 | { |
| 13 | assert(func1(5, 12345678) == 12345678); |
| 14 | } |
| 15 | |
| 16 | int func2(const(char)[] a, ...) |
| 17 | { |
| 18 | auto result = va_arg!int(_argptr); |
| 19 | return result; |
| 20 | } |
| 21 | |
| 22 | void test9495b() |
| 23 | { |
| 24 | assert(func2("5", 12345678) == 12345678); |
| 25 | } |
| 26 | |
| 27 | void main(string[] args) |
| 28 | { |
| 29 | test9495a(); |
| 30 | test9495b(); |
| 31 | } |