aboutsummaryrefslogtreecommitdiff
path: root/clang/test/CodeGenObjC/mangle-blocks.m
blob: 771030fdd2cf323d01210835f26d83b00c4dcfb4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// RUN: %clang_cc1 -triple i386-apple-ios -fblocks -emit-llvm -o - %s -Wno-objc-root-class \
// RUN:   | FileCheck %s

void __assert_rtn(const char *, const char *, int, const char *);

@interface Test
- (void (^)(void)) mangle;
@end

@implementation Test
- (void (^)(void)) mangle {
  return ^() {
    void (^b)(void) = ^() {
      __assert_rtn(__func__, __FILE__, __LINE__, "mangle");
    };
  };
}
@end

// CHECK: @"__func__.__14-[Test mangle]_block_invoke_2" = private unnamed_addr constant [30 x i8] c"-[Test mangle]_block_invoke_2\00", align 1
// CHECK: @.str{{.*}} = private unnamed_addr constant {{.*}}, align 1
// CHECK: @.str[[STR1:.*]] = private unnamed_addr constant [7 x i8] c"mangle\00", align 1

// CHECK: define internal void @"__14-[Test mangle]_block_invoke"(ptr noundef %.block_descriptor)

// CHECK: define internal void @"__14-[Test mangle]_block_invoke_2"(ptr noundef %.block_descriptor){{.*}}{
// CHECK: call void @__assert_rtn(ptr noundef @"__func__.__14-[Test mangle]_block_invoke_2", ptr noundef {{.*}}, i32 noundef 14, ptr noundef @.str[[STR1]])
// CHECK: }