diff options
Diffstat (limited to 'llvm/test/tools')
| -rwxr-xr-x | llvm/test/tools/dsymutil/Inputs/basic-lto.macho.x86_64 | bin | 0 -> 8912 bytes | |||
| -rw-r--r-- | llvm/test/tools/dsymutil/Inputs/basic-lto.macho.x86_64.o | bin | 0 -> 4516 bytes | |||
| -rwxr-xr-x | llvm/test/tools/dsymutil/Inputs/basic.macho.x86_64 | bin | 0 -> 9320 bytes | |||
| -rw-r--r-- | llvm/test/tools/dsymutil/Inputs/basic1.c | 25 | ||||
| -rw-r--r-- | llvm/test/tools/dsymutil/Inputs/basic1.macho.x86_64.o | bin | 0 -> 2376 bytes | |||
| -rw-r--r-- | llvm/test/tools/dsymutil/Inputs/basic2.c | 22 | ||||
| -rw-r--r-- | llvm/test/tools/dsymutil/Inputs/basic2.macho.x86_64.o | bin | 0 -> 3472 bytes | |||
| -rw-r--r-- | llvm/test/tools/dsymutil/Inputs/basic3.c | 20 | ||||
| -rw-r--r-- | llvm/test/tools/dsymutil/Inputs/basic3.macho.x86_64.o | bin | 0 -> 3008 bytes | |||
| -rw-r--r-- | llvm/test/tools/dsymutil/debug-map-parsing.test | 48 |
10 files changed, 115 insertions, 0 deletions
diff --git a/llvm/test/tools/dsymutil/Inputs/basic-lto.macho.x86_64 b/llvm/test/tools/dsymutil/Inputs/basic-lto.macho.x86_64 Binary files differnew file mode 100755 index 00000000000..b5ffb03c984 --- /dev/null +++ b/llvm/test/tools/dsymutil/Inputs/basic-lto.macho.x86_64 diff --git a/llvm/test/tools/dsymutil/Inputs/basic-lto.macho.x86_64.o b/llvm/test/tools/dsymutil/Inputs/basic-lto.macho.x86_64.o Binary files differnew file mode 100644 index 00000000000..c68e15acf31 --- /dev/null +++ b/llvm/test/tools/dsymutil/Inputs/basic-lto.macho.x86_64.o diff --git a/llvm/test/tools/dsymutil/Inputs/basic.macho.x86_64 b/llvm/test/tools/dsymutil/Inputs/basic.macho.x86_64 Binary files differnew file mode 100755 index 00000000000..8b3a34a5597 --- /dev/null +++ b/llvm/test/tools/dsymutil/Inputs/basic.macho.x86_64 diff --git a/llvm/test/tools/dsymutil/Inputs/basic1.c b/llvm/test/tools/dsymutil/Inputs/basic1.c new file mode 100644 index 00000000000..04e8f9391d1 --- /dev/null +++ b/llvm/test/tools/dsymutil/Inputs/basic1.c @@ -0,0 +1,25 @@ +/* This is the main file used to produce the basic* objects that are + used for the dsymutil tests. + + These are compiled in a couple of different ways (always on a + Darwin system): + Basic compilation: + for FILE in basic1.c basic2.c basic3.c; do + clang -g -c $FILE -o ${FILE%.c}.macho.x86_64.o + done + clang basic1.macho.x86_64.o basic2.macho.x86_64.o basic3.macho.x86_64.o -o basic.macho.x86_64 -Wl,-dead_strip + + LTO compilation: + for FILE in basic1.c basic2.c basic3.c; do + clang -g -c -flto $FILE -o ${FILE%.c}-lto.o + done + clang basic1-lto.o basic2-lto.o basic3-lto.o -o basic-lto.macho.x86_64 -Wl,-object_path_lto,$PWD/basic-lto.macho.x86_64.o -Wl,-dead_strip + rm basic1-lto.o basic2-lto.o basic3-lto.o + +*/ + +int foo(int); + +int main(int argc, const char *argv[]) { + return foo(argc); +} diff --git a/llvm/test/tools/dsymutil/Inputs/basic1.macho.x86_64.o b/llvm/test/tools/dsymutil/Inputs/basic1.macho.x86_64.o Binary files differnew file mode 100644 index 00000000000..d7b5000a612 --- /dev/null +++ b/llvm/test/tools/dsymutil/Inputs/basic1.macho.x86_64.o diff --git a/llvm/test/tools/dsymutil/Inputs/basic2.c b/llvm/test/tools/dsymutil/Inputs/basic2.c new file mode 100644 index 00000000000..13c6d07c2a0 --- /dev/null +++ b/llvm/test/tools/dsymutil/Inputs/basic2.c @@ -0,0 +1,22 @@ +/* For compilation instructions see basic1.c. */ + +static int baz = 42; +static int private_int; +extern volatile int val; +int unused_data = 1; + +int bar(int); + +void unused1() { + bar(baz); +} + +static int inc() { + return ++private_int; +} + +__attribute__((noinline)) +int foo(int arg) { + return bar(arg+val) + inc() + baz++; +} + diff --git a/llvm/test/tools/dsymutil/Inputs/basic2.macho.x86_64.o b/llvm/test/tools/dsymutil/Inputs/basic2.macho.x86_64.o Binary files differnew file mode 100644 index 00000000000..bdd82252e3a --- /dev/null +++ b/llvm/test/tools/dsymutil/Inputs/basic2.macho.x86_64.o diff --git a/llvm/test/tools/dsymutil/Inputs/basic3.c b/llvm/test/tools/dsymutil/Inputs/basic3.c new file mode 100644 index 00000000000..f20998a00db --- /dev/null +++ b/llvm/test/tools/dsymutil/Inputs/basic3.c @@ -0,0 +1,20 @@ +/* For compilation instructions see basic1.c. */ + +volatile int val; + +extern int foo(int); + +int unused2() { + return foo(val); +} + +static int inc() { + return ++val; +} + +__attribute__((noinline)) +int bar(int arg) { + if (arg > 42) + return inc(); + return foo(val + arg); +} diff --git a/llvm/test/tools/dsymutil/Inputs/basic3.macho.x86_64.o b/llvm/test/tools/dsymutil/Inputs/basic3.macho.x86_64.o Binary files differnew file mode 100644 index 00000000000..3c1c6399fd8 --- /dev/null +++ b/llvm/test/tools/dsymutil/Inputs/basic3.macho.x86_64.o diff --git a/llvm/test/tools/dsymutil/debug-map-parsing.test b/llvm/test/tools/dsymutil/debug-map-parsing.test new file mode 100644 index 00000000000..11d2fa77091 --- /dev/null +++ b/llvm/test/tools/dsymutil/debug-map-parsing.test @@ -0,0 +1,48 @@ +RUN: llvm-dsymutil -v -parse-only -oso-prepend-path=%p %p/Inputs/basic.macho.x86_64 | FileCheck %s +RUN: llvm-dsymutil -v -parse-only -oso-prepend-path=%p %p/Inputs/basic-lto.macho.x86_64 | FileCheck %s --check-prefix=CHECK-LTO +RUN: llvm-dsymutil -v -parse-only %p/Inputs/basic.macho.x86_64 2>&1 | FileCheck %s --check-prefix=NOT-FOUND +RUN: not llvm-dsymutil -v -parse-only %p/Inputs/inexistant 2>&1 | FileCheck %s --check-prefix=NO-EXECUTABLE +Check that We can parse the debug map of the basic executable. + +CHECK-NOT: error +CHECK: DEBUG MAP: +CHECK: /Inputs/basic1.macho.x86_64.o: +CHECK: 0000000000000000 => 0000000100000ea0 _main +CHECK: /Inputs/basic2.macho.x86_64.o: +CHECK: 0000000000000310 => 0000000100001000 _baz +CHECK: 0000000000000020 => 0000000100000ed0 _foo +CHECK: 0000000000000070 => 0000000100000f20 _inc +CHECK: 0000000000000560 => 0000000100001008 _private_int +CHECK: /Inputs/basic3.macho.x86_64.o: +CHECK: 0000000000000020 => 0000000100000f40 _bar +CHECK: 0000000000000070 => 0000000100000f90 _inc +CHECK: 0000000000000004 => 0000000100001004 _val +CHECK: END DEBUG MAP + + +Check that we can parse the debug-map of the basic-lto executable + +CHECK-LTO-NOT: error +CHECK-LTO: DEBUG MAP: +CHECK-LTO: /Inputs/basic-lto.macho.x86_64.o: +CHECK-LTO: 0000000000000050 => 0000000100000f90 _bar +CHECK-LTO: 0000000000000658 => 0000000100001000 _baz +CHECK-LTO: 0000000000000010 => 0000000100000f50 _foo +CHECK-LTO: 0000000000000000 => 0000000100000f40 _main +CHECK-LTO: 00000000000008e8 => 0000000100001008 _private_int +CHECK-LTO: 00000000000008ec => 0000000100001004 _val +CHECK-LTO: END DEBUG MAP + +Check that we warn about missing object files (this presumes that the files aren't +present in the machine's /Inputs/ folder, which should be a pretty safe bet). + +NOT-FOUND: cannot open{{.*}}"/Inputs/basic1.macho.x86_64.o": No such file +NOT-FOUND: cannot open{{.*}}"/Inputs/basic2.macho.x86_64.o": No such file +NOT-FOUND: cannot open{{.*}}"/Inputs/basic3.macho.x86_64.o": No such file +NOT-FOUND: DEBUG MAP: +NOT-FOUND-NEXT: END DEBUG MAP + +Check that we correctly error out on invalid executatble. + +NO-EXECUTABLE: cannot parse{{.*}}/inexistant": No such file +NO-EXECUTABLE-NOT: DEBUG MAP |

