| 1 |
# To rebuild the test case: |
| 2 |
# |
| 3 |
# $ cat op-convert-offset0.c |
| 4 |
# extern int a[2]; |
| 5 |
# |
| 6 |
# int foo(_Bool b) { |
| 7 |
# return b ? a[1] : a[0]; |
| 8 |
# } |
| 9 |
# $ cat op-convert-offset1.c |
| 10 |
# int a[2] = {1, 2}; |
| 11 |
# |
| 12 |
# int foo(_Bool); |
| 13 |
# |
| 14 |
# int main() { |
| 15 |
# return foo(0); |
| 16 |
# } |
| 17 |
# $ xcrun clang -g -O2 -c -target x86_64-apple-unknown-macho op-convert-offset1.c -emit-llvm |
| 18 |
# $ xcrun clang -g -O2 -c -target x86_64-apple-unknown-macho op-convert-offset0.c -emit-llvm |
| 19 |
# $ llvm-link op-convert-offset1.bc op-convert-offset0.bc -o op-convert-offset.ll -S |
| 20 |
# $ xcrun clang -c op-convert-offset.ll -O0 -arch x86_64 |
| 21 |
# $ xcrun clang -g op-convert-offset.o -O0 -arch x86_64 -o op-convert-offset |
| 22 |
|
| 23 |
RUN: dsymutil -oso-prepend-path %p/../Inputs %p/../Inputs/private/tmp/op-convert-offset/op-convert-offset -o %t.dSYM 2>&1 |
| 24 |
RUN: llvm-dwarfdump %p/../Inputs/private/tmp/op-convert-offset/op-convert-offset.o 2>&1 | FileCheck %s --check-prefix OBJ |
| 25 |
RUN: llvm-dwarfdump %t.dSYM 2>&1 | FileCheck %s --check-prefix DSYM |
| 26 |
|
| 27 |
RUN: dsymutil --linker parallel -oso-prepend-path %p/../Inputs \ |
| 28 |
RUN: %p/../Inputs/private/tmp/op-convert-offset/op-convert-offset \ |
| 29 |
RUN: -o %t.dSYM 2>&1 |
| 30 |
RUN: llvm-dwarfdump \ |
| 31 |
RUN: %p/../Inputs/private/tmp/op-convert-offset/op-convert-offset.o 2>&1 \ |
| 32 |
RUN: | FileCheck %s --check-prefix OBJ |
| 33 |
RUN: llvm-dwarfdump %t.dSYM 2>&1 | FileCheck %s --check-prefix DSYM |
| 34 |
|
| 35 |
OBJ: 0x0000007d: DW_TAG_base_type |
| 36 |
OBJ: DW_AT_name ("DW_ATE_unsigned_1") |
| 37 |
OBJ: DW_AT_encoding (DW_ATE_unsigned) |
| 38 |
OBJ: DW_AT_byte_size (0x01) |
| 39 |
|
| 40 |
OBJ: 0x00000094: DW_TAG_formal_parameter |
| 41 |
OBJ: DW_AT_location (DW_OP_breg2 RCX+0, DW_OP_constu 0xff, DW_OP_and, DW_OP_convert (0x0000007d) "DW_ATE_unsigned_1", DW_OP_convert (0x00000081) "DW_ATE_unsigned_8", DW_OP_stack_value) |
| 42 |
OBJ: DW_AT_name ("b") |
| 43 |
OBJ: DW_AT_type (0x000000af "_Bool") |
| 44 |
|
| 45 |
DSYM: DW_TAG_compile_unit |
| 46 |
DSYM: DW_TAG_compile_unit |
| 47 |
DSYM: DW_TAG_base_type |
| 48 |
DSYM: DW_AT_name ("DW_ATE_unsigned_1") |
| 49 |
DSYM: DW_AT_encoding (DW_ATE_unsigned) |
| 50 |
DSYM: DW_AT_byte_size (0x01) |
| 51 |
|
| 52 |
DSYM: DW_TAG_formal_parameter |
| 53 |
DSYM: DW_AT_location (DW_OP_breg2 RCX+0, DW_OP_constu 0xff, DW_OP_and, DW_OP_convert (0x00000084) "DW_ATE_unsigned_1", DW_OP_convert (0x00000088) "DW_ATE_unsigned_8", DW_OP_stack_value) |
| 54 |
DSYM: DW_AT_name ("b") |
| 55 |
DSYM: DW_AT_type ({{.*}} "_Bool") |