reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
    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
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
   62
   63
   64
   65
   66
   67
   68
   69
   70
   71
   72
# RUN: yaml2obj %s -o %t1.o

# RUN: wasm-ld --no-entry --features=foo,bar,baz -o %t.specified.wasm %t1.o
# RUN: obj2yaml %t.specified.wasm | FileCheck %s --check-prefix SPECIFIED

# RUN: wasm-ld --no-entry --features=bar,baz,quux -o %t.unspecified.wasm %t1.o
# RUN: obj2yaml %t.unspecified.wasm | FileCheck %s --check-prefix UNSPECIFIED

# RUN: yaml2obj %S/Inputs/disallow-feature-foo.yaml -o %t.disallowed.o
# RUN: wasm-ld --no-entry -o - %t1.o %t.disallowed.o | obj2yaml | FileCheck %s --check-prefix DISALLOWED

# RUN: yaml2obj %S/Inputs/no-feature-foo.yaml -o %t.none.o
# RUN: wasm-ld --no-entry -o - %t1.o %t.none.o | obj2yaml | FileCheck %s --check-prefix NONE

# Check that the following combinations of feature linkage policies
# give the expected results:
#
#     DISALLOWED x DISALLOWED => NONE
#     DISALLOWED x NONE => NONE

--- !WASM
FileHeader:
  Version:         0x00000001
Sections:
  - Type:            CUSTOM
    Name:            linking
    Version:         2
  - Type:            CUSTOM
    Name:            target_features
    Features:
      - Prefix:        DISALLOWED
        Name:          "foo"
        # included so output has target features section
      - Prefix:        USED
        Name:          "bar"
...

# SPECIFIED:        - Type:            CUSTOM
# SPECIFIED-NEXT:     Name:            target_features
# SPECIFIED-NEXT:     Features:
# SPECIFIED-NEXT:       - Prefix:          USED
# SPECIFIED-NEXT:         Name:            bar
# SPECIFIED-NEXT:       - Prefix:          USED
# SPECIFIED-NEXT:         Name:            baz
# SPECIFIED-NEXT:       - Prefix:          USED
# SPECIFIED-NEXT:         Name:            foo
# SPECIFIED-NEXT: ...

# UNSPECIFIED:        - Type:            CUSTOM
# UNSPECIFIED-NEXT:     Name:            target_features
# UNSPECIFIED-NEXT:     Features:
# UNSPECIFIED-NEXT:       - Prefix:          USED
# UNSPECIFIED-NEXT:         Name:            bar
# UNSPECIFIED-NEXT:       - Prefix:          USED
# UNSPECIFIED-NEXT:         Name:            baz
# UNSPECIFIED-NEXT:       - Prefix:          USED
# UNSPECIFIED-NEXT:         Name:            quux
# UNSPECIFIED-NEXT: ...

# DISALLOWED:        - Type:            CUSTOM
# DISALLOWED-NEXT:     Name:            target_features
# DISALLOWED-NEXT:     Features:
# DISALLOWED-NEXT:       - Prefix:          USED
# DISALLOWED-NEXT:         Name:            bar
# DISALLOWED-NEXT: ...

# NONE:        - Type:            CUSTOM
# NONE-NEXT:     Name:            target_features
# NONE-NEXT:     Features:
# NONE-NEXT:       - Prefix:          USED
# NONE-NEXT:         Name:            bar
# NONE-NEXT: ...