1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00
llvm-mirror/test/Bitcode/local-linkage-default-visibility.3.4.ll
David Blaikie 65b92c4f37 [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 03:22:04 +00:00

81 lines
2.4 KiB
LLVM

; RUN: llvm-dis < %s.bc | FileCheck %s
; RUN: verify-uselistorder < %s.bc
; local-linkage-default-visibility.3.4.ll.bc was generated by passing this file
; to llvm-as-3.4. The test checks that LLVM upgrades visibility of symbols
; with local linkage to default visibility.
@default.internal.var = internal global i32 0
; CHECK: @default.internal.var = internal global i32 0
@hidden.internal.var = internal hidden global i32 0
; CHECK: @hidden.internal.var = internal global i32 0
@protected.internal.var = internal protected global i32 0
; CHECK: @protected.internal.var = internal global i32 0
@default.private.var = private global i32 0
; CHECK: @default.private.var = private global i32 0
@hidden.private.var = private hidden global i32 0
; CHECK: @hidden.private.var = private global i32 0
@protected.private.var = private protected global i32 0
; CHECK: @protected.private.var = private global i32 0
@global = global i32 0
@default.internal.alias = alias internal i32, internal i32* @global
; CHECK: @default.internal.alias = internal alias i32, i32* @global
@hidden.internal.alias = hidden alias internal i32, internal i32* @global
; CHECK: @hidden.internal.alias = internal alias i32, i32* @global
@protected.internal.alias = protected alias internal i32, internal i32* @global
; CHECK: @protected.internal.alias = internal alias i32, i32* @global
@default.private.alias = alias private i32, private i32* @global
; CHECK: @default.private.alias = private alias i32, i32* @global
@hidden.private.alias = hidden alias private i32, private i32* @global
; CHECK: @hidden.private.alias = private alias i32, i32* @global
@protected.private.alias = protected alias private i32, private i32* @global
; CHECK: @protected.private.alias = private alias i32, i32* @global
define internal void @default.internal() {
; CHECK: define internal void @default.internal
entry:
ret void
}
define internal hidden void @hidden.internal() {
; CHECK: define internal void @hidden.internal
entry:
ret void
}
define internal protected void @protected.internal() {
; CHECK: define internal void @protected.internal
entry:
ret void
}
define private void @default.private() {
; CHECK: define private void @default.private
entry:
ret void
}
define private hidden void @hidden.private() {
; CHECK: define private void @hidden.private
entry:
ret void
}
define private protected void @protected.private() {
; CHECK: define private void @protected.private
entry:
ret void
}