llvm-project/llvm/test/Object/X86/nm-ir.ll

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

53 lines
999 B
LLVM
Raw Normal View History

; RUN: llvm-as %s -o - | llvm-nm - | FileCheck %s
; CHECK: D a1
; CHECK-NEXT: d a2
; CHECK-NEXT: T f1
; CHECK-NEXT: t f2
; CHECK-NEXT: W f3
; CHECK-NEXT: U f4
; CHECK-NEXT: w f5
; CHECK-NEXT: D g1
; CHECK-NEXT: d g2
; CHECK-NEXT: C g3
; CHECK-NOT: g4
; CHECK-NEXT: T global_asm_sym
; CHECK-NEXT: T ifunc_f1
; CHECK-NEXT: t local_asm_sym
; CHECK-NEXT: U undef_asm_sy
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
module asm ".global global_asm_sym"
module asm "global_asm_sym:"
module asm "local_asm_sym:"
module asm ".long undef_asm_sym"
@g1 = global i32 42
@g2 = internal global i32 42
@g3 = common global i32 0
@g4 = private global i32 42
[opaque pointer type] Add textual IR support for explicit type parameter for global aliases update.py: import fileinput import sys import re alias_match_prefix = r"(.*(?:=|:|^)\s*(?:external |)(?:(?:private|internal|linkonce|linkonce_odr|weak|weak_odr|common|appending|extern_weak|available_externally) )?(?:default |hidden |protected )?(?:dllimport |dllexport )?(?:unnamed_addr |)(?:thread_local(?:\([a-z]*\))? )?alias" plain = re.compile(alias_match_prefix + r" (.*?))(| addrspace\(\d+\) *)\*($| *(?:%|@|null|undef|blockaddress|addrspacecast|\[\[[a-zA-Z]|\{\{).*$)") cast = re.compile(alias_match_prefix + r") ((?:bitcast|inttoptr|addrspacecast)\s*\(.* to (.*?)(| addrspace\(\d+\) *)\*\)\s*(?:;.*)?$)") gep = re.compile(alias_match_prefix + r") ((?:getelementptr)\s*(?:inbounds)?\s*\((?P<type>.*), (?P=type)(?:\s*addrspace\(\d+\)\s*)?\* .*\)\s*(?:;.*)?$)") def conv(line): m = re.match(cast, line) if m: return m.group(1) + " " + m.group(3) + ", " + m.group(2) m = re.match(gep, line) if m: return m.group(1) + " " + m.group(3) + ", " + m.group(2) m = re.match(plain, line) if m: return m.group(1) + ", " + m.group(2) + m.group(3) + "*" + m.group(4) + "\n" return line for line in sys.stdin: sys.stdout.write(conv(line)) apply.sh: for name in "$@" do python3 `dirname "$0"`/update.py < "$name" > "$name.tmp" && mv "$name.tmp" "$name" rm -f "$name.tmp" done The actual commands: From llvm/src: find test/ -name *.ll | xargs ./apply.sh From llvm/src/tools/clang: find test/ -name *.mm -o -name *.m -o -name *.cpp -o -name *.c | xargs -I '{}' ../../apply.sh "{}" From llvm/src/tools/polly: find test/ -name *.ll | xargs ./apply.sh llvm-svn: 247378
2015-09-11 11:22:04 +08:00
@a1 = alias i32, i32* @g1
@a2 = internal alias i32, i32* @g1
define void @f1() {
call void @f5()
ret void
}
@ifunc_f1 = ifunc void (), void ()* @f1
define internal void @f2() {
ret void
}
define linkonce_odr void @f3() {
ret void
}
declare void @f4()
declare extern_weak void @f5()