2013-11-14 06:58:53 +08:00
|
|
|
// RUN: %clang_cc1 %s -emit-llvm -o - -fms-extensions -triple i686-pc-win32 | FileCheck %s
|
|
|
|
|
2018-02-24 03:30:48 +08:00
|
|
|
// CHECK-LABEL: define dso_local void @test_alloca(
|
2013-11-14 06:58:53 +08:00
|
|
|
void capture(void *);
|
|
|
|
void test_alloca(int n) {
|
|
|
|
capture(_alloca(n));
|
2016-10-28 01:18:24 +08:00
|
|
|
// CHECK: %[[arg:.*]] = alloca i8, i32 %{{.*}}, align 16
|
2013-11-14 06:58:53 +08:00
|
|
|
// CHECK: call void @capture(i8* %[[arg]])
|
|
|
|
}
|
2016-10-31 13:37:48 +08:00
|
|
|
|
2018-02-24 03:30:48 +08:00
|
|
|
// CHECK-LABEL: define dso_local void @test_alloca_with_align(
|
2016-10-31 13:37:48 +08:00
|
|
|
void test_alloca_with_align(int n) {
|
|
|
|
capture(__builtin_alloca_with_align(n, 64));
|
|
|
|
// CHECK: %[[arg:.*]] = alloca i8, i32 %{{.*}}, align 8
|
|
|
|
// CHECK: call void @capture(i8* %[[arg]])
|
|
|
|
}
|