xref: /llvm-project/clang/test/Modules/decl-attr-merge.mm (revision 169417531578501e955f12c79ecb8ff05333ae15)
1// RUN: rm -rf %t.dir
2// RUN: split-file %s %t.dir
3// RUN: %clang_cc1 -fmodules -fimplicit-module-maps \
4// RUN:   -fmodules-cache-path=%t.dir/cache -triple x86_64-apple-macosx10.11.0 \
5// RUN:   -I%t.dir/headers %t.dir/main.m -emit-llvm -o %t.dir/main.ll
6// RUN: cat %t.dir/main.ll | FileCheck %s
7
8//--- headers/a.h
9
10__attribute__((availability(macos,introduced=10.16)))
11@interface INIntent
12- (instancetype)self;
13@end
14
15//--- headers/b.h
16
17@class INIntent;
18
19//--- headers/module.modulemap
20
21module A {
22  header "a.h"
23}
24
25module B {
26  header "b.h"
27}
28
29//--- main.m
30
31#import <a.h>
32#import <b.h> // NOTE: Non attributed decl imported after one with attrs.
33
34void F(id);
35
36int main() {
37  if (@available(macOS 11.0, *))
38    F([INIntent self]);
39}
40
41// CHECK: @"OBJC_CLASS_$_INIntent" = extern_weak
42