Skip to content
functions.c 1.23 KiB
Newer Older
// RUN: %clang_cc1 %s -emit-llvm -o - -verify | FileCheck %s
  return g(i);
  return g(i);
// rdar://6110827
typedef void T(void);
void test3(T f) {
  f();
}

// CHECK: define void @f0()
// CHECK: call void @f1()
// CHECK: define void @f1()
// CHECK: define {{.*}} @f3{{\(\)|\(.*sret.*\)}}
Mike Stump's avatar
Mike Stump committed
  while (1) {}
Chris Lattner's avatar
Chris Lattner committed

// PR4423 - This shouldn't crash in codegen
void f4() {}
void f5() { f4(42); } //expected-warning {{too many arguments}}

// Qualifiers on parameter types shouldn't make a difference.
static void f6(const float f, const float g) {
}
void f7(float f, float g) {
  f6(f, g);
// CHECK: define void @f7(float{{.*}}, float{{.*}})
// CHECK: call void @f6(float{{.*}}, float{{.*}})
}

// PR6911 - incomplete function types
struct Incomplete;
void f8_callback(struct Incomplete);
void f8_user(void (*callback)(struct Incomplete));
void f8_test() {
  f8_user(&f8_callback);
// CHECK: define void @f8_test()
// CHECK: call void @f8_user({{.*}}* bitcast (void ()* @f8_callback to {{.*}}*))
// CHECK: declare void @f8_user({{.*}}*)
// CHECK: declare void @f8_callback()
}