|
3 | 3 | # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos11.0 -I %t %t/cat1.s -o %t/cat1.o
|
4 | 4 | # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos11.0 -I %t %t/cat2.s -o %t/cat2.o
|
5 | 5 | # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos11.0 -I %t %t/klass.s -o %t/klass.o
|
| 6 | +# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos11.0 -I %t %t/cat1.s -g -o %t/cat1_w_sym.o |
| 7 | +# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos11.0 -I %t %t/cat2.s -g -o %t/cat2_w_sym.o |
| 8 | +# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos11.0 -I %t %t/klass.s -g -o %t/klass_w_sym.o |
6 | 9 | # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos11.0 -I %t %t/cat1.s --defsym MAKE_LOAD_METHOD=1 -o %t/cat1-with-load.o
|
7 | 10 | # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos11.0 -I %t %t/cat2.s --defsym MAKE_LOAD_METHOD=1 -o %t/cat2-with-load.o
|
8 | 11 | # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos11.0 -I %t %t/klass.s --defsym MAKE_LOAD_METHOD=1 -o %t/klass-with-load.o
|
|
14 | 17 | # RUN: %no-fatal-warnings-lld --check-category-conflicts -dylib -lobjc %t/libklass.dylib %t/cat1.o \
|
15 | 18 | # RUN: %t/cat2.o -o /dev/null 2>&1 | FileCheck %s --check-prefix=CATCAT
|
16 | 19 |
|
| 20 | +# RUN: %no-fatal-warnings-lld --check-category-conflicts -dylib -lobjc %t/klass_w_sym.o %t/cat1_w_sym.o %t/cat2_w_sym.o -o \ |
| 21 | +# RUN: /dev/null 2>&1 | FileCheck %s --check-prefixes=CATCLS_W_SYM,CATCAT_W_SYM |
| 22 | +# RUN: %no-fatal-warnings-lld --check-category-conflicts -dylib -lobjc %t/libklass.dylib %t/cat1_w_sym.o \ |
| 23 | +# RUN: %t/cat2_w_sym.o -o /dev/null 2>&1 | FileCheck %s --check-prefix=CATCAT_W_SYM |
| 24 | + |
17 | 25 | ## Check that we don't emit spurious warnings around the +load method while
|
18 | 26 | ## still emitting the other warnings. Note that we have made separate
|
19 | 27 | ## `*-with-load.s` files for ease of comparison with ld64; ld64 will not warn
|
|
45 | 53 | # CATCAT-NEXT: >>> defined in category Cat2 from {{.*}}cat2{{.*}}.o
|
46 | 54 | # CATCAT-NEXT: >>> defined in category Cat1 from {{.*}}cat1{{.*}}.o
|
47 | 55 |
|
| 56 | + |
| 57 | +# CATCLS_W_SYM: warning: method '+s1' has conflicting definitions: |
| 58 | +# CATCLS_W_SYM-NEXT: >>> defined in category Cat1 from {{.*}}cat1_w_sym{{.*}}.o ({{.*}}cat1.s{{.*}}) |
| 59 | +# CATCLS_W_SYM-NEXT: >>> defined in class Foo from {{.*}}klass_w_sym{{.*}}.o ({{.*}}klass.s{{.*}}) |
| 60 | + |
| 61 | +# CATCLS_W_SYM: warning: method '-m1' has conflicting definitions: |
| 62 | +# CATCLS_W_SYM-NEXT: >>> defined in category Cat1 from {{.*}}cat1_w_sym{{.*}}.o ({{.*}}cat1.s{{.*}}) |
| 63 | +# CATCLS_W_SYM-NEXT: >>> defined in class Foo from {{.*}}klass_w_sym{{.*}}.o ({{.*}}klass.s{{.*}}) |
| 64 | + |
| 65 | +# CATCAT_W_SYM: warning: method '+s2' has conflicting definitions: |
| 66 | +# CATCAT_W_SYM-NEXT: >>> defined in category Cat2 from {{.*}}cat2_w_sym{{.*}}.o ({{.*}}cat2.s{{.*}}) |
| 67 | +# CATCAT_W_SYM-NEXT: >>> defined in category Cat1 from {{.*}}cat1_w_sym{{.*}}.o ({{.*}}cat1.s{{.*}}) |
| 68 | + |
| 69 | +# CATCAT_W_SYM: warning: method '-m2' has conflicting definitions: |
| 70 | +# CATCAT_W_SYM-NEXT: >>> defined in category Cat2 from {{.*}}cat2_w_sym{{.*}}.o ({{.*}}cat2.s{{.*}}) |
| 71 | +# CATCAT_W_SYM-NEXT: >>> defined in category Cat1 from {{.*}}cat1_w_sym{{.*}}.o ({{.*}}cat1.s{{.*}}) |
| 72 | + |
| 73 | + |
48 | 74 | #--- cat1.s
|
49 | 75 |
|
50 | 76 | .include "objc-macros.s"
|
|
55 | 81 | ## +(void) s1;
|
56 | 82 | ## +(void) s2;
|
57 | 83 | ## @end
|
58 |
| -## |
| 84 | +## |
59 | 85 | ## @implementation Foo(Cat1)
|
60 | 86 | ## -(void) m1 {}
|
61 | 87 | ## -(void) m2 {}
|
@@ -114,7 +140,7 @@ __OBJC_$_CATEGORY_CLASS_METHODS_Foo_$_Cat1:
|
114 | 140 | ## -(void) m2;
|
115 | 141 | ## +(void) s2;
|
116 | 142 | ## @end
|
117 |
| -## |
| 143 | +## |
118 | 144 | ## @implementation Foo(Cat2)
|
119 | 145 | ## -(void) m2 {}
|
120 | 146 | ## +(void) s2 {}
|
|
0 commit comments