1 # RUN: yaml2obj %s -o %t1.o
3 # RUN: wasm-ld --no-entry --features=foo,bar,baz -o - %t1.o | obj2yaml | FileCheck %s --check-prefix SPECIFIED
5 # RUN: not wasm-ld --no-entry --features=bar,baz,quux -o /dev/null %t1.o 2>&1 | FileCheck %s --check-prefix UNSPECIFIED
7 # RUN: wasm-ld --no-entry --no-check-features --features=bar,baz,quux -o - %t1.o | obj2yaml | FileCheck %s --check-prefix UNSPECIFIED-NOCHECK
9 # RUN: yaml2obj %S/Inputs/use-feature-foo.yaml -o %t.used.o
10 # RUN: wasm-ld --no-entry -o - %t1.o %t.used.o | obj2yaml | FileCheck %s --check-prefix USED
12 # RUN: yaml2obj %S/Inputs/require-feature-foo.yaml -o %t.required.o
13 # RUN: wasm-ld --no-entry -o - %t1.o %t.required.o | obj2yaml | FileCheck %s --check-prefix REQUIRED
15 # RUN: yaml2obj %S/Inputs/disallow-feature-foo.yaml -o %t.disallowed.o
16 # RUN: not wasm-ld --no-entry -o /dev/null %t1.o %t.disallowed.o 2>&1 | FileCheck %s --check-prefix DISALLOWED
18 # RUN: wasm-ld --no-entry --no-check-features -o - %t1.o %t.disallowed.o | obj2yaml | FileCheck %s --check-prefix DISALLOWED-NOCHECK
20 # RUN: yaml2obj %S/Inputs/no-feature-foo.yaml -o %t.none.o
21 # RUN: wasm-ld --no-entry -o - %t1.o %t.none.o | obj2yaml | FileCheck %s --check-prefix NONE
23 # Check that the following combinations of feature linkage policies
24 # give the expected results:
27 # USED x REQUIRED => USED
28 # USED x DISALLOWED => Error
45 # SPECIFIED: - Type: CUSTOM
46 # SPECIFIED: Name: target_features
47 # SPECIFIED-NEXT: Features:
48 # SPECIFIED-NEXT: - Prefix: USED
49 # SPECIFIED-NEXT: Name: bar
50 # SPECIFIED-NEXT: - Prefix: USED
51 # SPECIFIED-NEXT: Name: baz
52 # SPECIFIED-NEXT: - Prefix: USED
53 # SPECIFIED-NEXT: Name: foo
56 # UNSPECIFIED: Target feature 'foo' used by {{.*}}target-feature-used.yaml.tmp1.o is not allowed.{{$}}
58 # UNSPECIFIED-NOCHECK: - Type: CUSTOM
59 # UNSPECIFIED-NOCHECK: Name: target_features
60 # UNSPECIFIED-NOCHECK-NEXT: Features:
61 # UNSPECIFIED-NOCHECK-NEXT: - Prefix: USED
62 # UNSPECIFIED-NOCHECK-NEXT: Name: bar
63 # UNSPECIFIED-NOCHECK-NEXT: - Prefix: USED
64 # UNSPECIFIED-NOCHECK-NEXT: Name: baz
65 # UNSPECIFIED-NOCHECK-NEXT: - Prefix: USED
66 # UNSPECIFIED-NOCHECK-NEXT: Name: quux
67 # UNSPECIFIED-NOCHECK-NEXT: ...
69 # USED: - Type: CUSTOM
70 # USED: Name: target_features
71 # USED-NEXT: Features:
72 # USED-NEXT: - Prefix: USED
73 # USED-NEXT: Name: foo
76 # REQUIRED: - Type: CUSTOM
77 # REQUIRED: Name: target_features
78 # REQUIRED-NEXT: Features:
79 # REQUIRED-NEXT: - Prefix: USED
80 # REQUIRED-NEXT: Name: foo
83 # DISALLOWED: Target feature 'foo' used in {{.*}}target-feature-used.yaml.tmp1.o is disallowed by {{.*}}target-feature-used.yaml.tmp.disallowed.o. Use --no-check-features to suppress.{{$}}
85 # DISALLOWED-NOCHECK: - Type: CUSTOM
86 # DISALLOWED-NOCHECK: Name: target_features
87 # DISALLOWED-NOCHECK-NEXT: Features:
88 # DISALLOWED-NOCHECK-NEXT: - Prefix: USED
89 # DISALLOWED-NOCHECK-NEXT: Name: foo
90 # DISALLOWED-NOCHECK-NEXT: ...
92 # NONE: - Type: CUSTOM
93 # NONE: Name: target_features
94 # NONE-NEXT: Features:
95 # NONE-NEXT: - Prefix: USED
96 # NONE-NEXT: Name: foo