1 // RUN: %clang_cc1 -triple x86_64-windows-msvc -fms-extensions -emit-llvm < %s | FileCheck %s
3 _Static_assert(sizeof(void *) == 8, "sizeof(void *) has unexpected value. Expected 8.");
6 // CHECK: define dso_local i32 @foo
7 // CHECK: %a = alloca ptr addrspace(270), align 4
14 // CHECK: define dso_local i32 @bar
15 // CHECK: %p = alloca ptr addrspace(270), align 4
23 // CHECK: define dso_local i32 @baz
24 // CHECK: %p = alloca ptr addrspace(270), align 4
26 typedef int *__ptr32 IP32_PTR
;
33 // CHECK: define dso_local i32 @fugu
34 // CHECK: %p = alloca ptr addrspace(270), align 4
36 typedef int *int_star
;
42 typedef __SIZE_TYPE__
size_t;
43 size_t strlen(const char *);
45 size_t test_calling_strlen_with_32_bit_pointer ( char *__ptr32 s
) {
46 // CHECK-LABEL: define dso_local i64 @test_calling_strlen_with_32_bit_pointer(ptr addrspace(270) noundef %s)
48 // CHECK-NEXT: %s.addr = alloca ptr addrspace(270), align 4
49 // CHECK-NEXT: store ptr addrspace(270) %s, ptr %s.addr, align 4
50 // CHECK-NEXT: %0 = load ptr addrspace(270), ptr %s.addr, align 4
51 // CHECK-NEXT: %1 = addrspacecast ptr addrspace(270) %0 to ptr
52 // CHECK-NEXT: %call = call i64 @strlen(ptr noundef %1)
53 // CHECK-NEXT: ret i64 %call
57 // CHECK-LABEL: declare dso_local i64 @strlen(ptr noundef)
59 size_t test_calling_strlen_with_64_bit_pointer ( char *s
) {
60 // CHECK-LABEL: define dso_local i64 @test_calling_strlen_with_64_bit_pointer(ptr noundef %s)
62 // CHECK-NEXT: %s.addr = alloca ptr, align 8
63 // CHECK-NEXT: store ptr %s, ptr %s.addr, align 8
64 // CHECK-NEXT: %0 = load ptr, ptr %s.addr, align 8
65 // CHECK-NEXT: %call = call i64 @strlen(ptr noundef %0)
66 // CHECK-NEXT: ret i64 %call