xref: /llvm-project/clang/test/CodeGenObjC/attr-nomerge.m (revision bc6b139392f638a69e85a474eb0eb59e13d9791a)
1// RUN: %clang_cc1 -emit-llvm -fobjc-exceptions -triple x86_64-unknown-linux -o - %s | FileCheck %s
2
3// Test that the nomerge attribute is applied to function calls
4// in @try, @catch and @finally
5void opaque(void);
6void opaque2(void);
7void opaque3(void);
8
9int main(int argc, const char * argv[]) {
10  __attribute__((nomerge)) @try {
11    opaque();
12  } @catch(...) {
13    opaque2();
14  } @finally {
15    opaque3();
16  }
17
18  return 0;
19}
20
21// CHECK: call void @opaque() #[[ATTR0:[0-9]+]]
22// CHECK-DAG: call void @opaque2() #[[ATTR0]]
23// CHECK-DAG: call void @opaque3() #[[ATTR0]]
24// CHECK-DAG: attributes #[[ATTR0]] = {{{.*}}nomerge{{.*}}}
25