1 # RUN: yaml2obj -D NAME= %s | llvm-nm - | FileCheck --check-prefix=FBAR %s
4 # RUN: yaml2obj -D NAME=o %s | llvm-nm - | FileCheck --check-prefix=FOOBAR %s
5 # RUN: yaml2obj -DNAME=o %s | llvm-nm - | FileCheck --check-prefix=FOOBAR %s
8 # RUN: not yaml2obj -D NAME %s 2>&1 | FileCheck --check-prefix=ERR1 %s
9 # ERR1: error: invalid syntax for -D: NAME
11 # RUN: not yaml2obj -D =value %s 2>&1 | FileCheck --check-prefix=ERR2 %s
12 # ERR2: error: invalid syntax for -D: =value
14 # RUN: not yaml2obj -D NAME=a -D NAME=b %s 2>&1 | FileCheck --check-prefix=ERR3 %s
15 # ERR3: error: 'NAME' redefined
24 - Name: f[[NAME]][[NAME]]bar
26 ## Digits can appear in macro names. Test that we don't expand macros recursively.
27 # RUN: yaml2obj --docnum=2 -D a0='[[a1]]' -D a1='[[a0]]' %s | llvm-nm --just-symbol-name --no-sort - > %t.recur
28 # RUN: echo -e '[[a1]]\n[[a0]]' > %t0.recur
29 # RUN: diff -u %t0.recur %t.recur
41 ## Test unterminated [[.
42 # RUN: yaml2obj --docnum=3 %s | llvm-nm --just-symbol-name --no-sort - > %t.nosubst
43 # RUN: echo -e 'a[[\n[[a]\n[[a[[a]]\n[[a][[a]][[b]]' > %t0.nosubst
44 # RUN: diff -u %t0.nosubst %t.nosubst
46 # RUN: yaml2obj --docnum=3 -D a=b -D b=c %s | llvm-nm --just-symbol-name --no-sort - > %t.subst
47 # RUN: echo -e 'a[[\n[[a]\n[[ab\n[[a]bc' > %t0.subst
48 # RUN: diff -u %t0.subst %t.subst
60 - Name: "[[a][[a]][[b]]"
62 ## Check that it is possible to set a default value for a macro in the YAML description.
63 ## Check that we are able to provide an empty default value for a macro.
64 # RUN: yaml2obj --docnum=4 %s -o %t4.1
65 # RUN: llvm-nm --no-sort %t4.1 | FileCheck %s --check-prefix=DEFAULT
80 ## Check that it is possible to override a default macro value.
81 # RUN: yaml2obj --docnum=4 %s -o %t4.2 -DFOO=bar -DBAR=foo
82 # RUN: llvm-nm --no-sort %t4.2 | FileCheck %s --check-prefix=OVERRIDE-DEFAULT1
84 # OVERRIDE-DEFAULT1: U _bar_
85 # OVERRIDE-DEFAULT1-NEXT: U _foo_
87 # RUN: yaml2obj --docnum=4 %s -o %t4.3 -DFOO=bar=foo -DBAR=foo=bar
88 # RUN: llvm-nm --no-sort %t4.3 | FileCheck %s --check-prefix=OVERRIDE-DEFAULT2
90 # OVERRIDE-DEFAULT2: U _bar=foo_
91 # OVERRIDE-DEFAULT2-NEXT: U _foo=bar_