// RUN: %clang_cc1 -no-opaque-pointers -triple=i686-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefixes=CHECK,LINUX
// RUN: %clang_cc1 -no-opaque-pointers -triple=i686-apple-darwin9 -emit-llvm %s -o - | FileCheck %s --check-prefixes=CHECK,DARWIN
char *asm;
int x ;
int *
// LINUX: @bar = internal global i32 0
// LINUX: @foo ={{.*}} global i32 0
// LINUX: declare i8* @alias(i32 noundef)
// DARWIN: @"\01bar" = internal global i32 0
// DARWIN: @"\01foo" ={{.*}} global i32 0
// DARWIN: declare i8* @"\01alias"(i32 noundef)
extern void *;
extern memcpy asm;
void
// CHECK-LABEL: @test_memcpy(
// LINUX: call i8* @__GI_memcpy(
// LINUX: declare i8* @__GI_memcpy(i8* noundef, i8* noundef, i32 noundef)
// DARWIN: call i8* @"\01__GI_memcpy"(
// DARWIN: declare i8* @"\01__GI_memcpy"(i8* noundef, i8* noundef, i32 noundef)
long asm;
long
// CHECK-LABEL: @test_lrint(
// LINUX: call i32 @__GI_lrint(
// LINUX: declare i32 @__GI_lrint(double noundef)
// DARWIN: call i32 @"\01__GI_lrint"(
// DARWIN: declare i32 @"\01__GI_lrint"(double noundef)
/// NOTE: GCC can optimize out abs in -O1 or above. Clang does not
/// communicate the mapping to the backend so the libcall cannot be eliminated.
int asm;
long
// CHECK-LABEL: @test_abs(
// LINUX: call i32 @__GI_abs(
/// FIXME: test_sin should call real_sin instead.
double asm;
double
// CHECK-LABEL: @test_sin(
// LINUX: call double @llvm.sin.f64(