xref: /llvm-project/clang/test/Driver/xcoff-build-id.c (revision f39c399d9d15efe8309d8aa3d0ecf62205e6c474)
1 // RUN: touch %t.o
2 // RUN: %clang --target=powerpc64-ibm-aix -### %t.o -mxcoff-build-id=0x12 2>&1 | FileCheck %s
3 // Test that:
4 //  1) our ldrinfo flag comes before any user specified ldrinfo flag;
5 //  2) upper case hex digits are converted to lower case;
6 //  3) a zero is added when odd number of digits is specified in the HEXSTRING.
7 // RUN: %clang --target=powerpc-ibm-aix -### %t.o -Wl,-bdbg:ldrinfo:FOO -mxcoff-build-id=0x011ffFF 2>&1 | FileCheck %s --check-prefix=OTHER
8 
9 // RUN: not %clang --target=powerpc-ibm-aix -### %t.o -mxcoff-build-id=ff 2>&1 | FileCheck %s --check-prefix=BAD_INPUT
10 // RUN: not %clang --target=powerpc-ibm-aix -### %t.o -mxcoff-build-id=0x0z  2>&1 | FileCheck %s --check-prefix=BAD_INPUT
11 
12 CHECK: "-bdbg:ldrinfo:xcoff_binary_id:0x12"
13 OTHER: "-bdbg:ldrinfo:xcoff_binary_id:0x0011ffff" {{.*}} "-bdbg:ldrinfo:FOO"
14 BAD_INPUT: clang: error: unsupported argument {{.*}} to option '-mxcoff-build-id='
15