[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / CodeGen / X86 / x86-long-double.cpp
blob89d6256c9e32b0925e655f9f8a11473eeee7e0a1
1 // RUN: %clang_cc1 %s -emit-llvm -o - -triple=i686 | \
2 // RUN: FileCheck --check-prefixes=FP80,FP80-ELF32 %s
3 // RUN: %clang_cc1 %s -emit-llvm -o - -triple=i686-apple-darwin | \
4 // RUN: FileCheck --check-prefixes=FP80,FP80-DARWIN %s
5 // RUN: %clang_cc1 %s -emit-llvm -o - -triple=x86_64 | \
6 // RUN: FileCheck --check-prefixes=FP80,FP80-ELF64 %s
7 // RUN: %clang_cc1 %s -emit-llvm -o - -triple=x86_64-apple-darwin | \
8 // RUN: FileCheck --check-prefixes=FP80,FP80-DARWIN %s
10 // RUN: %clang_cc1 %s -emit-llvm -o - -triple=i686 -mlong-double-64 | \
11 // RUN: FileCheck --check-prefixes=FP64,FP64-X32 %s
12 // RUN: %clang_cc1 %s -emit-llvm -o - -triple=i686-apple-darwin -mlong-double-64 | \
13 // RUN: FileCheck --check-prefixes=FP64,FP64-X32 %s
14 // RUN: %clang_cc1 %s -emit-llvm -o - -triple=x86_64 -mlong-double-64 | \
15 // RUN: FileCheck --check-prefixes=FP64,FP64-X64 %s
16 // RUN: %clang_cc1 %s -emit-llvm -o - -triple=x86_64-apple-darwin -mlong-double-64 | \
17 // RUN: FileCheck --check-prefixes=FP64,FP64-X64 %s
19 // RUN: %clang_cc1 %s -emit-llvm -o - -triple=i686 -mlong-double-128 | \
20 // RUN: FileCheck --check-prefix=FP128 %s
21 // RUN: %clang_cc1 %s -emit-llvm -o - -triple=i686-apple-darwin -mlong-double-128 | \
22 // RUN: FileCheck --check-prefix=FP128 %s
23 // RUN: %clang_cc1 %s -emit-llvm -o - -triple=x86_64 -mlong-double-128 | \
24 // RUN: FileCheck --check-prefix=FP128 %s
25 // RUN: %clang_cc1 %s -emit-llvm -o - -triple=x86_64-apple-darwin -mlong-double-128 | \
26 // RUN: FileCheck --check-prefix=FP128 %s
28 // Check -malign-double increases the alignment from 4 to 8 on x86-32.
29 // RUN: %clang_cc1 %s -emit-llvm -o - -triple=i686 -mlong-double-64 \
30 // RUN: -malign-double | FileCheck --check-prefixes=FP64,FP64-X64 %s
31 // RUN: %clang_cc1 %s -emit-llvm -o - -triple=x86_64 -mlong-double-64 \
32 // RUN: -malign-double | FileCheck --check-prefixes=FP64,FP64-X64 %s
34 long double x = 0;
35 int size = sizeof(x);
37 // FP80-ELF32: @x ={{.*}} global x86_fp80 {{.*}}, align 4
38 // FP80-ELF32: @size ={{.*}} global i32 12
39 // FP80-ELF64: @x ={{.*}} global x86_fp80 {{.*}}, align 16
40 // FP80-ELF64: @size ={{.*}} global i32 16
41 // FP80-DARWIN: @x ={{.*}} global x86_fp80 {{.*}}, align 16
42 // FP80-DARWIN: @size ={{.*}} global i32 16
44 // FP64-X32: @x ={{.*}} global double {{.*}}, align 4
45 // FP64-X32: @size ={{.*}} global i32 8
46 // FP64-X64: @x ={{.*}} global double {{.*}}, align 8
47 // FP64-X64: @size ={{.*}} global i32 8
49 // FP128: @x ={{.*}} global fp128 {{.*}}, align 16
50 // FP128: @size ={{.*}} global i32 16
52 long double foo(long double d) { return d; }
54 // FP64: double @_Z3fooe(double noundef %d)
55 // FP80: x86_fp80 @_Z3fooe(x86_fp80 noundef %d)
56 // FP128: fp128 @_Z3foog(fp128 noundef %d)