blob: 282fa4f9f50c747b48bae349d4cb9b5d9520652e [file] [log] [blame]
Stephen Hines176edba2014-12-01 14:53:08 -08001// 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 Nainar3ea9e332015-04-08 08:57:32 -070014// 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 Hines176edba2014-12-01 14:53:08 -080016
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
21typedef struct { int array[12]; } BigStruct_t;
22BigStruct_t (^a)() = ^(int param) {
23 BigStruct_t b;
24 return b;
25};