File: no-symbols-warning.test

package info (click to toggle)
llvm-toolchain-16 1%3A16.0.6-15~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,634,792 kB
  • sloc: cpp: 6,179,261; ansic: 1,216,205; asm: 741,319; python: 196,614; objc: 75,325; f90: 49,640; lisp: 32,396; pascal: 12,286; sh: 9,394; perl: 7,442; ml: 5,494; awk: 3,523; makefile: 2,723; javascript: 1,206; xml: 886; fortran: 581; cs: 573
file content (55 lines) | stat: -rw-r--r-- 1,910 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
## This test verifies that the tool emits a warning for object files
## without symbols.

# RUN: yaml2obj --docnum=1 %s -o %t-x86_64-empty.o
# RUN: yaml2obj --docnum=2 %s -o %t-armv7-empty.o
# RUN: echo 'target triple = "arm64-apple-ios8.0.0"' | llvm-as -o %t-empty.bc
# RUN: yaml2obj %S/Inputs/input1.yaml -o %t-non-empty.o

# RUN: llvm-libtool-darwin -static -o %t.lib %t-x86_64-empty.o 2>&1 | \
# RUN:   FileCheck --check-prefix=WARNING %s -DPREFIX=%basename_t.tmp

# WARNING: warning: '[[PREFIX]]-x86_64-empty.o': has no symbols for architecture x86_64

# RUN: not llvm-libtool-darwin -static -warnings_as_errors -o %t-error.lib %t-x86_64-empty.o 2>&1 | \
# RUN:   FileCheck --check-prefix=ERROR %s -DPREFIX=%basename_t.tmp

# ERROR: error: '[[PREFIX]]-x86_64-empty.o': has no symbols for architecture x86_64

# RUN: llvm-libtool-darwin -no_warning_for_no_symbols -static -o %t.lib \
# RUN:   %t-x86_64-empty.o 2>&1 | \
# RUN:   FileCheck %s --allow-empty --implicit-check-not='warning:'

# RUN: llvm-libtool-darwin -static -o %t.lib %t-non-empty.o 2>&1 | \
# RUN:   FileCheck %s --allow-empty --implicit-check-not='warning:'

# RUN: llvm-libtool-darwin -arch_only x86_64 -static -o %t.lib \
# RUN:   %t-non-empty.o %t-armv7-empty.o 2>&1 | \
# RUN:   FileCheck %s --allow-empty --implicit-check-not='warning:'

# RUN: llvm-libtool-darwin -static -o %t.lib %t-empty.bc 2>&1 | \
# RUN:   FileCheck %s --allow-empty --implicit-check-not='warning:'

## x86_64
--- !mach-o
FileHeader:
  magic:           0xFEEDFACF
  cputype:         0x1000007
  cpusubtype:      0x3
  filetype:        0x1
  ncmds:           0
  sizeofcmds:      0
  flags:           0x2000
  reserved:        0x0
...

## armv7
--- !mach-o
FileHeader:
  magic:           0xFEEDFACE
  cputype:         0x0000000C
  cpusubtype:      0x00000009
  filetype:        0x00000001
  ncmds:           0
  sizeofcmds:      0
  flags:           0x00002000