Stephen Hines | 176edba | 2014-12-01 14:53:08 -0800 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -g -fblocks -emit-llvm -o - %s | FileCheck %s |
| 2 | |
| 3 | // Check that arg numbering is not affected by LLVM IR argument numbering - |
| 4 | // since the latter is affected by return-by-out-parameter ABI requirements |
| 5 | |
| 6 | // 1 for the argument number (1 indexed), 2 for the line number |
| 7 | // 16777218 == 1 << 24 | 2 |
| 8 | // 33554434 == 2 << 24 | 2 |
| 9 | // This explains the two magic numbers below, testing that these two arguments |
| 10 | // are numbered correctly. If they are not numbered correctly they may appear |
| 11 | // out of order or not at all (the latter would occur if they were both assigned |
| 12 | // the same argument number by mistake). |
| 13 | |
Pirama Arumuga Nainar | 3ea9e33 | 2015-04-08 08:57:32 -0700 | [diff] [blame] | 14 | // CHECK: !MDLocalVariable(tag: DW_TAG_arg_variable, name: ".block_descriptor", arg: 1,{{.*}}line: 2, |
| 15 | // CHECK: !MDLocalVariable(tag: DW_TAG_arg_variable, name: "param", arg: 2,{{.*}}line: 2, |
Stephen Hines | 176edba | 2014-12-01 14:53:08 -0800 | [diff] [blame] | 16 | |
| 17 | // Line directive so we don't have to worry about how many lines preceed the |
| 18 | // test code (as the line number is mangled in with the argument number as shown |
| 19 | // above) |
| 20 | #line 1 |
| 21 | typedef struct { int array[12]; } BigStruct_t; |
| 22 | BigStruct_t (^a)() = ^(int param) { |
| 23 | BigStruct_t b; |
| 24 | return b; |
| 25 | }; |