2013-04-05 02:59:24 +08:00
|
|
|
# RUN: not lld -core --undefines-are-errors %s 2> %t.err
|
2012-04-20 09:24:37 +08:00
|
|
|
# RUN: FileCheck -check-prefix=CHECKERR < %t.err %s
|
2013-04-05 02:59:24 +08:00
|
|
|
# RUN: lld -core %s | FileCheck %s
|
2012-04-19 05:55:06 +08:00
|
|
|
|
|
|
|
#
|
2012-04-20 09:24:37 +08:00
|
|
|
# Test that -undefines-are-errors triggers and error
|
|
|
|
# and that not using that option results in undefined atoms.
|
2012-04-19 05:55:06 +08:00
|
|
|
#
|
|
|
|
|
|
|
|
---
|
2013-01-05 10:22:35 +08:00
|
|
|
defined-atoms:
|
2012-04-19 05:55:06 +08:00
|
|
|
- name: foo
|
|
|
|
type: code
|
|
|
|
|
2013-01-05 10:22:35 +08:00
|
|
|
undefined-atoms:
|
2012-04-19 05:55:06 +08:00
|
|
|
- name: malloc
|
|
|
|
- name: free
|
|
|
|
---
|
2013-01-05 10:22:35 +08:00
|
|
|
defined-atoms:
|
2012-04-19 05:55:06 +08:00
|
|
|
- name: bar
|
|
|
|
type: code
|
|
|
|
|
2013-01-05 10:22:35 +08:00
|
|
|
undefined-atoms:
|
2012-04-19 05:55:06 +08:00
|
|
|
- name: malloc
|
|
|
|
- name: myfunc
|
|
|
|
---
|
2013-01-05 10:22:35 +08:00
|
|
|
defined-atoms:
|
2012-04-19 05:55:06 +08:00
|
|
|
- name: myfunc
|
|
|
|
scope: global
|
|
|
|
type: code
|
|
|
|
|
2013-01-05 10:22:35 +08:00
|
|
|
undefined-atoms:
|
2012-04-19 05:55:06 +08:00
|
|
|
- name: free
|
|
|
|
...
|
|
|
|
|
2012-04-20 09:24:37 +08:00
|
|
|
# CHECKERR: free
|
|
|
|
# CHECKERR: malloc
|
|
|
|
# CHECKERR: symbol(s) not found
|
|
|
|
|
2013-01-05 10:22:35 +08:00
|
|
|
# CHECK: defined-atoms:
|
2012-04-20 09:24:37 +08:00
|
|
|
# CHECK: name: foo
|
|
|
|
# CHECK: name: bar
|
|
|
|
# CHECK: name: myfunc
|
2013-01-05 10:22:35 +08:00
|
|
|
# CHECK: undefined-atoms:
|
2012-04-20 09:24:37 +08:00
|
|
|
# CHECK: name: malloc
|
|
|
|
# CHECK: name: free
|
|
|
|
# CHECK: ...
|