From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/CodeGen/available-externally-suppress.c | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 clang/test/CodeGen/available-externally-suppress.c (limited to 'clang/test/CodeGen/available-externally-suppress.c') diff --git a/clang/test/CodeGen/available-externally-suppress.c b/clang/test/CodeGen/available-externally-suppress.c new file mode 100644 index 0000000..46b6e74 --- /dev/null +++ b/clang/test/CodeGen/available-externally-suppress.c @@ -0,0 +1,27 @@ +// RUN: %clang_cc1 -emit-llvm -o - -O0 -triple x86_64-apple-darwin10 %s | FileCheck %s + +// Ensure that we don't emit available_externally functions at -O0. +int x; + +inline void f0(int y) { x = y; } + +// CHECK: define void @test() +// CHECK: declare void @f0(i32) +void test() { + f0(17); +} + +inline int __attribute__((always_inline)) f1(int x) { + int blarg = 0; + for (int i = 0; i < x; ++i) + blarg = blarg + x * i; + return blarg; +} + +// CHECK: @test1 +int test1(int x) { + // CHECK: br i1 + // CHECK-NOT: call {{.*}} @f1 + // CHECK: ret i32 + return f1(x); +} -- cgit v1.2.3