aboutsummaryrefslogtreecommitdiff
path: root/clang/test/CodeGen/builtins-ms.c
blob: ec3d884cb6da4f401704885708e64d004f9e065c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// RUN: %clang_cc1 %s -emit-llvm -o - -fms-extensions -triple i686-pc-win32 | FileCheck %s

// CHECK-LABEL: define dso_local void @test_alloca(
void capture(void *);
void test_alloca(int n) {
  capture(_alloca(n));
  // CHECK: %[[arg:.*]] = alloca i8, i32 %{{.*}}, align 16
  // CHECK: call void @capture(ptr noundef %[[arg]])
}

// CHECK-LABEL: define dso_local void @test_alloca_with_align(
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(ptr noundef %[[arg]])
}