File: x86-long-double.cpp

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,998,520 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (56 lines) | stat: -rw-r--r-- 2,677 bytes parent folder | download | duplicates (16)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// RUN: %clang_cc1 %s -emit-llvm -o - -triple=i686 | \
// RUN:   FileCheck --check-prefixes=FP80,FP80-ELF32 %s
// RUN: %clang_cc1 %s -emit-llvm -o - -triple=i686-apple-darwin | \
// RUN:   FileCheck --check-prefixes=FP80,FP80-DARWIN %s
// RUN: %clang_cc1 %s -emit-llvm -o - -triple=x86_64 | \
// RUN:   FileCheck --check-prefixes=FP80,FP80-ELF64 %s
// RUN: %clang_cc1 %s -emit-llvm -o - -triple=x86_64-apple-darwin | \
// RUN:   FileCheck --check-prefixes=FP80,FP80-DARWIN %s

// RUN: %clang_cc1 %s -emit-llvm -o - -triple=i686 -mlong-double-64 | \
// RUN:   FileCheck --check-prefixes=FP64,FP64-X32 %s
// RUN: %clang_cc1 %s -emit-llvm -o - -triple=i686-apple-darwin -mlong-double-64 | \
// RUN:   FileCheck --check-prefixes=FP64,FP64-X32 %s
// RUN: %clang_cc1 %s -emit-llvm -o - -triple=x86_64 -mlong-double-64 | \
// RUN:   FileCheck --check-prefixes=FP64,FP64-X64 %s
// RUN: %clang_cc1 %s -emit-llvm -o - -triple=x86_64-apple-darwin -mlong-double-64 | \
// RUN:   FileCheck --check-prefixes=FP64,FP64-X64 %s

// RUN: %clang_cc1 %s -emit-llvm -o - -triple=i686 -mlong-double-128 | \
// RUN:   FileCheck --check-prefix=FP128 %s
// RUN: %clang_cc1 %s -emit-llvm -o - -triple=i686-apple-darwin -mlong-double-128 | \
// RUN:   FileCheck --check-prefix=FP128 %s
// RUN: %clang_cc1 %s -emit-llvm -o - -triple=x86_64 -mlong-double-128 | \
// RUN:   FileCheck --check-prefix=FP128 %s
// RUN: %clang_cc1 %s -emit-llvm -o - -triple=x86_64-apple-darwin -mlong-double-128 | \
// RUN:   FileCheck --check-prefix=FP128 %s

// Check -malign-double increases the alignment from 4 to 8 on x86-32.
// RUN: %clang_cc1 %s -emit-llvm -o - -triple=i686 -mlong-double-64 \
// RUN:   -malign-double | FileCheck --check-prefixes=FP64,FP64-X64 %s
// RUN: %clang_cc1 %s -emit-llvm -o - -triple=x86_64 -mlong-double-64 \
// RUN:   -malign-double | FileCheck --check-prefixes=FP64,FP64-X64 %s

long double x = 0;
int size = sizeof(x);

// FP80-ELF32: @x ={{.*}} global x86_fp80 {{.*}}, align 4
// FP80-ELF32: @size ={{.*}} global i32 12
// FP80-ELF64: @x ={{.*}} global x86_fp80 {{.*}}, align 16
// FP80-ELF64: @size ={{.*}} global i32 16
// FP80-DARWIN: @x ={{.*}} global x86_fp80 {{.*}}, align 16
// FP80-DARWIN: @size ={{.*}} global i32 16

// FP64-X32: @x ={{.*}} global double {{.*}}, align 4
// FP64-X32: @size ={{.*}} global i32 8
// FP64-X64: @x ={{.*}} global double {{.*}}, align 8
// FP64-X64: @size ={{.*}} global i32 8

// FP128: @x ={{.*}} global fp128 {{.*}}, align 16
// FP128: @size ={{.*}} global i32 16

long double foo(long double d) { return d; }

// FP64: double @_Z3fooe(double noundef %d)
// FP80: x86_fp80 @_Z3fooe(x86_fp80 noundef %d)
// FP128: fp128 @_Z3foog(fp128 noundef %d)