brintos

brintos / llvm-project-archived public Read only

0
0
Text · 971 B · 0a5930f Raw
41 lines · plain
1; RUN: llvm-as <%s >%t12; RUN: llvm-lto -exported-symbol=_uses_puts -exported-symbol=_uses_printf -o - %t1 | \3; RUN: llvm-nm - | \4; RUN: FileCheck %s5; rdar://problem/161651916; runtime library implementations should not be renamed7 8target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"9target triple = "x86_64-apple-darwin11"10 11@str = private unnamed_addr constant [13 x i8] c"hello world\0A\00"12 13; CHECK-NOT: U _puts14; CHECK: T _uses_printf15; CHECK: T _uses_puts16define i32 @uses_puts(i32 %i) {17entry:18  %s = call ptr @foo(i32 %i)19  %ret = call i32 @puts(ptr %s)20  ret i32 %ret21}22define i32 @uses_printf(i32 %i) {23entry:24  call i32 (ptr, ...) @printf(ptr @str)25  ret i32 026}27 28define hidden i32 @printf(ptr readonly nocapture %fmt, ...) {29entry:30  %ret = call i32 @bar(ptr %fmt)31  ret i32 %ret32}33define hidden i32 @puts(ptr %s) {34entry:35  %ret = call i32 @bar(ptr %s)36  ret i32 %ret37}38 39declare ptr @foo(i32)40declare i32 @bar(ptr)41