Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / CodeGen / varargs.c
blob625399b87f7ad7a41be97568a88ddbcafc3d5691
1 // RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm -o - %s | FileCheck %s
3 // PR6433 - Don't crash on va_arg(typedef).
4 typedef double gdouble;
5 void focus_changed_cb (void) {
6 __builtin_va_list pa;
7 double mfloat;
8 mfloat = __builtin_va_arg((pa), gdouble);
11 void vararg(int, ...);
12 void function_as_vararg(void) {
13 // CHECK: define {{.*}}function_as_vararg
14 // CHECK-NOT: llvm.trap
15 vararg(0, focus_changed_cb);
18 void vla(int n, ...)
20 __builtin_va_list ap;
21 void *p;
22 p = __builtin_va_arg(ap, typeof (int (*)[++n])); // CHECK: add nsw i32 {{.*}}, 1