xref: /llvm-project/clang/test/Driver/defsym.s (revision d712ae4a21822a51817941e7007e0dd41343cde3)
1// XFAIL: target={{.*}}-aix{{.*}}
2
3// RUN: %clang -### -c -integrated-as %s \
4// RUN: -Wa,-defsym,abc=5 -Wa,--defsym,xyz=0xa \
5// RUN: 2>&1 | FileCheck %s --check-prefix=CHECK-DEFSYM1
6
7// RUN: %clang -### -c -no-integrated-as -target x86_64-unknown-unknown %s \
8// RUN: -Wa,-defsym,abc=5 -Wa,--defsym,xyz=0xa \
9// RUN: 2>&1 | FileCheck %s --check-prefix=CHECK-DEFSYM1-GAS
10
11// CHECK-DEFSYM1: "--defsym" "abc=5" "--defsym" "xyz=0xa"
12// CHECK-DEFSYM1-GAS: "-defsym" "abc=5" "--defsym" "xyz=0xa"
13
14// RUN: not %clang -c -integrated-as -o /dev/null %s \
15// RUN: -Wa,-defsym,abc= \
16// RUN: 2>&1 | FileCheck %s --check-prefix=CHECK-DEFSYM-ERR1
17// CHECK-DEFSYM-ERR1: error: defsym must be of the form: sym=value: abc=
18
19// RUN: not %clang -c -integrated-as -o /dev/null %s \
20// RUN: -Wa,-defsym,=123 \
21// RUN: 2>&1 | FileCheck %s --check-prefix=CHECK-DEFSYM-ERR2
22// CHECK-DEFSYM-ERR2: error: defsym must be of the form: sym=value: =123
23
24// RUN: not %clang -c -integrated-as -o /dev/null %s \
25// RUN: -Wa,-defsym,abc=1a2b3c \
26// RUN: 2>&1 | FileCheck %s --check-prefix=CHECK-DEFSYM-ERR3
27// CHECK-DEFSYM-ERR3: error: value is not an integer: 1a2b3c
28
29// RUN: not %clang -c -integrated-as -o /dev/null %s \
30// RUN: -Wa,-defsym \
31// RUN: 2>&1 | FileCheck %s --check-prefix=CHECK-DEFSYM-ERR4
32
33// RUN: not %clang -c -integrated-as -o /dev/null %s \
34// RUN: -Wa,-defsym, \
35// RUN: 2>&1 | FileCheck %s --check-prefix=CHECK-DEFSYM-ERR4
36
37// CHECK-DEFSYM-ERR4: error: defsym must be of the form: sym=value: -defsym
38