brintos

brintos / llvm-project-archived public Read only

0
0
Text · 12.2 KiB · cab6368 Raw
258 lines · c
1// Test that -ffp-contract is set to the right value when combined with2// the options -ffast-math, -fno-fast-math, funsafe-math-optimizations,3// fno-unsafe-math-optimizations.4 5// These warning checks are above the run lines because the warning is reported6// before the drive options that are checked below the run lines.7// WARN_FM_OFF: warning: overriding '-ffast-math' option with '-ffp-contract=off'8// WARN_FM_ON: warning: overriding '-ffast-math' option with '-ffp-contract=on'9// WARN_FM_FHP: warning: overriding '-ffast-math' option with '-ffp-contract=fast-honor-pragmas'10// WARN_UM_OFF: warning: overriding '-funsafe-math-optimizations' option with '-ffp-contract=off'11// WARN_UM_ON: warning: overriding '-funsafe-math-optimizations' option with '-ffp-contract=on'12 13// ffast-math, fno-fast-math14// RUN: %clang -### -ffast-math -c %s 2>&1  \15// RUN:   | FileCheck --check-prefix=CHECK-FPC-FAST %s16// CHECK-FPC-FAST:     "-ffp-contract=fast"17 18// RUN: %clang -### -fno-fast-math -c %s 2>&1 \19// RUN:   | FileCheck --check-prefix=CHECK-FPC-ON %s20 21// RUN: %clang -### -ffast-math -ffp-contract=on -c %s 2>&1 \22// RUN:   | FileCheck --check-prefixes=CHECK-FPC-ON,WARN_FM_ON %s23// CHECK-FPC-ON:       "-ffp-contract=on"24 25// RUN: %clang -### -ffast-math -ffp-contract=off -c %s 2>&1 \26// RUN:   | FileCheck --check-prefixes=CHECK-FPC-OFF,WARN_FM_OFF %s27// CHECK-FPC-OFF:      "-ffp-contract=off"28 29// RUN: %clang -### -Werror -ffast-math -ffp-contract=fast -c %s 2>&1 \30// RUN:   | FileCheck --check-prefix=CHECK-FPC-FAST %s31 32// RUN: %clang -### -ffast-math -ffp-contract=fast-honor-pragmas -c %s 2>&1 \33// RUN:   | FileCheck --check-prefixes=CHECK-FPC-FAST-HONOR,WARN_FM_FHP %s34// CHECK-FPC-FAST-HONOR:     "-ffp-contract=fast-honor-pragmas"35 36// RUN: %clang -### -Werror -ffp-contract=fast -ffast-math -c %s 2>&1 \37// RUN:   | FileCheck --check-prefix=CHECK-FPC-FAST %s38// RUN: %clang -### -Werror -ffp-contract=on -ffast-math -c %s 2>&1 \39// RUN:   | FileCheck --check-prefix=CHECK-FPC-FAST %s40// RUN: %clang -### -Werror -ffp-contract=off -ffast-math -c %s 2>&1 \41// RUN:   | FileCheck --check-prefix=CHECK-FPC-FAST %s42 43// RUN: %clang -### -Werror -ffp-contract=fast -fno-fast-math -c %s 2>&1 \44// RUN:   | FileCheck --check-prefix=CHECK-FPC-FAST %s45// RUN: %clang -### -Werror -ffp-contract=on -fno-fast-math -c %s 2>&1 \46// RUN:   | FileCheck --check-prefix=CHECK-FPC-ON %s47// RUN: %clang -### -Werror -ffp-contract=off -fno-fast-math -c %s 2>&1 \48// RUN:   | FileCheck --check-prefix=CHECK-FPC-OFF %s49 50 51// RUN: %clang -### -Werror -ffast-math -ffp-contract=fast -ffp-contract=on -c %s 2>&1 \52// RUN:   | FileCheck --check-prefix=CHECK-FPC-ON %s53 54// RUN: %clang -### -ffast-math -ffp-contract=on -ffp-contract=off -c %s 2>&1 \55// RUN:   | FileCheck --check-prefixes=CHECK-FPC-OFF,WARN_FM_ON %s56 57// RUN: %clang -### -ffast-math -ffp-contract=on -ffp-contract=fast -c %s 2>&1 \58// RUN:   | FileCheck --check-prefixes=CHECK-FPC-FAST,WARN_FM_ON %s59 60// RUN: %clang -### -ffast-math -ffp-contract=off -ffp-contract=on -c %s 2>&1 \61// RUN:   | FileCheck --check-prefixes=CHECK-FPC-ON,WARN_FM_OFF %s62 63// RUN: %clang -### -ffast-math -ffp-contract=off -ffp-contract=fast \64// RUN: -c %s 2>&1 | FileCheck --check-prefixes=CHECK-FPC-FAST,WARN_FM_OFF %s65 66// RUN: %clang -### -ffast-math -ffp-contract=on -fno-fast-math -c %s 2>&1 \67// RUN:   | FileCheck --check-prefixes=CHECK-FPC-ON,WARN_FM_ON %s68 69// RUN: %clang -### -ffast-math -ffp-contract=off -fno-fast-math -c %s 2>&1 \70// RUN:   | FileCheck --check-prefixes=CHECK-FPC-OFF,WARN_FM_OFF %s71 72// RUN: %clang -### -Werror -ffast-math -ffp-contract=fast -fno-fast-math -c %s 2>&1 \73// RUN:   | FileCheck --check-prefix=CHECK-FPC-FAST %s74 75// RUN: %clang -### -Werror -ffast-math -fno-fast-math -c %s 2>&1 \76// RUN:   | FileCheck --check-prefix=CHECK-FPC-ON %s77 78// RUN: %clang -### -Werror -fno-fast-math -ffast-math -c %s 2>&1 \79// RUN:   | FileCheck --check-prefix=CHECK-FPC-FAST %s80 81// RUN: %clang -### -Werror -fno-fast-math -ffp-contract=on -c %s 2>&1 \82// RUN:   | FileCheck --check-prefix=CHECK-FPC-ON %s83 84// RUN: %clang -### -Werror -fno-fast-math -ffp-contract=off -c %s 2>&1 \85// RUN:   | FileCheck --check-prefix=CHECK-FPC-OFF %s86 87// RUN: %clang -### -Werror -fno-fast-math -ffp-contract=fast -c %s 2>&1 \88// RUN:   | FileCheck --check-prefix=CHECK-FPC-FAST %s89 90// RUN: %clang -### -Werror -ffp-contract=fast -fno-fast-math -ffp-contract=on \91// RUN: -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-ON %s92 93// RUN: %clang -### -Werror -ffp-contract=fast -fno-fast-math -ffp-contract=off \94// RUN: -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-OFF %s95 96// RUN: %clang -### -Werror -ffp-contract=off -fno-fast-math -ffp-contract=fast \97// RUN: -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-FAST %s98 99// RUN: %clang -### -Werror -ffp-contract=off -fno-fast-math -ffp-contract=on \100// RUN: -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-ON %s101 102// RUN: %clang -### -Werror -ffp-contract=on -ffast-math -c %s 2>&1 \103// RUN:   | FileCheck --check-prefix=CHECK-FPC-FAST %s104 105// RUN: %clang -### -Werror -ffp-contract=off -ffast-math -c %s 2>&1 \106// RUN:   | FileCheck --check-prefix=CHECK-FPC-FAST %s107 108// RUN: %clang -### -Werror -ffp-contract=fast -ffast-math -c %s 2>&1 \109// RUN:   | FileCheck --check-prefix=CHECK-FPC-FAST %s110 111// RUN: %clang -### -Werror -ffp-contract=on -ffast-math -fno-fast-math -c %s 2>&1 \112// RUN:   | FileCheck --check-prefix=CHECK-FPC-ON %s113 114// RUN: %clang -### -Werror -ffp-contract=off -ffast-math -fno-fast-math -c %s 2>&1 \115// RUN:   | FileCheck --check-prefix=CHECK-FPC-OFF %s116 117// RUN: %clang -### -Werror -ffp-contract=fast -ffast-math -fno-fast-math -c %s 2>&1 \118// RUN:   | FileCheck --check-prefix=CHECK-FPC-FAST %s119 120// RUN: %clang -### -Werror -fno-fast-math -ffast-math -ffp-contract=fast \121// RUN: -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-FAST %s122 123// RUN: %clang -### -fno-fast-math -ffast-math -ffp-contract=on \124// RUN: -c %s 2>&1 | FileCheck --check-prefixes=CHECK-FPC-ON,WARN_FM_ON %s125 126// RUN: %clang -### -fno-fast-math -ffast-math -ffp-contract=off \127// RUN: -c %s 2>&1 | FileCheck --check-prefixes=CHECK-FPC-OFF,WARN_FM_OFF %s128 129// funsafe-math-optimizations, fno-unsafe-math-optimizations130// RUN: %clang -### -Werror -funsafe-math-optimizations -c %s 2>&1  \131// RUN:   | FileCheck --check-prefix=CHECK-FPC-FAST %s132 133// RUN: %clang -### -Werror -fno-unsafe-math-optimizations -c %s 2>&1 \134// RUN:   | FileCheck --check-prefix=CHECK-FPC-ON %s135 136// RUN: %clang -### -funsafe-math-optimizations -ffp-contract=on -c %s 2>&1 \137// RUN:   | FileCheck --check-prefixes=CHECK-FPC-ON,WARN_UM_ON %s138 139// RUN: %clang -### -funsafe-math-optimizations -ffp-contract=off -c %s 2>&1 \140// RUN:   | FileCheck --check-prefixes=CHECK-FPC-OFF,WARN_UM_OFF %s141 142// RUN: %clang -### -Werror -funsafe-math-optimizations -ffp-contract=fast -c %s 2>&1 \143// RUN:   | FileCheck --check-prefix=CHECK-FPC-FAST %s144 145// RUN: %clang -### -Werror -ffp-contract=fast -funsafe-math-optimizations -c %s 2>&1 \146// RUN:   | FileCheck --check-prefix=CHECK-FPC-FAST %s147// RUN: %clang -### -Werror -ffp-contract=on -funsafe-math-optimizations -c %s 2>&1 \148// RUN:   | FileCheck --check-prefix=CHECK-FPC-FAST %s149// RUN: %clang -### -Werror -ffp-contract=off -funsafe-math-optimizations -c %s 2>&1 \150// RUN:   | FileCheck --check-prefix=CHECK-FPC-FAST %s151 152// RUN: %clang -### -Werror -ffp-contract=fast -fno-unsafe-math-optimizations -c \153// RUN: %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-FAST %s154// RUN: %clang -### -Werror -ffp-contract=on -fno-unsafe-math-optimizations -c %s 2>&1 \155// RUN:   | FileCheck --check-prefix=CHECK-FPC-ON %s156// RUN: %clang -### -Werror -ffp-contract=off -fno-unsafe-math-optimizations -c %s 2>&1 \157// RUN:   | FileCheck --check-prefix=CHECK-FPC-OFF %s158 159// RUN: %clang -### -Werror -funsafe-math-optimizations -ffp-contract=fast \160// RUN: -ffp-contract=on -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-ON %s161 162// RUN: %clang -### -funsafe-math-optimizations -ffp-contract=on \163// RUN: -ffp-contract=off -c %s 2>&1 | FileCheck --check-prefixes=CHECK-FPC-OFF,WARN_UM_ON %s164 165// RUN: %clang -### -funsafe-math-optimizations -ffp-contract=on \166// RUN: -ffp-contract=fast -c %s 2>&1 \167// RUN:   | FileCheck --check-prefixes=CHECK-FPC-FAST,WARN_UM_ON %s168 169// RUN: %clang -### -funsafe-math-optimizations -ffp-contract=off \170// RUN: -ffp-contract=on -c %s 2>&1 | FileCheck --check-prefixes=CHECK-FPC-ON,WARN_UM_OFF %s171 172// RUN: %clang -### -funsafe-math-optimizations -ffp-contract=off \173// RUN: -ffp-contract=fast \174// RUN: -c %s 2>&1 | FileCheck --check-prefixes=CHECK-FPC-FAST,WARN_UM_OFF %s175 176// RUN: %clang -### -funsafe-math-optimizations -ffp-contract=on \177// RUN: -fno-unsafe-math-optimizations -c %s 2>&1 \178// RUN:   | FileCheck --check-prefixes=CHECK-FPC-ON,WARN_UM_ON %s179 180// RUN: %clang -### -funsafe-math-optimizations -ffp-contract=off \181// RUN: -fno-unsafe-math-optimizations -c %s 2>&1 \182// RUN:   | FileCheck --check-prefixes=CHECK-FPC-OFF,WARN_UM_OFF %s183 184// RUN: %clang -### -Werror -funsafe-math-optimizations -ffp-contract=fast \185// RUN: -fno-unsafe-math-optimizations -c %s 2>&1 \186// RUN:   | FileCheck --check-prefix=CHECK-FPC-FAST %s187 188// RUN: %clang -### -Werror -funsafe-math-optimizations -fno-unsafe-math-optimizations \189// RUN: -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-ON %s190 191// RUN: %clang -### -Werror -fno-unsafe-math-optimizations -funsafe-math-optimizations \192// RUN: -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-FAST %s193 194// RUN: %clang -### -Werror -fno-unsafe-math-optimizations -ffp-contract=on -c %s 2>&1 \195// RUN:   | FileCheck --check-prefix=CHECK-FPC-ON %s196 197// RUN: %clang -### -Werror -fno-unsafe-math-optimizations -ffp-contract=off -c %s 2>&1 \198// RUN:   | FileCheck --check-prefix=CHECK-FPC-OFF %s199 200// RUN: %clang -### -Werror -fno-unsafe-math-optimizations -ffp-contract=fast -c %s 2>&1 \201// RUN:   | FileCheck --check-prefix=CHECK-FPC-FAST %s202 203// RUN: %clang -### -Werror -ffp-contract=fast -fno-unsafe-math-optimizations \204// RUN: -ffp-contract=on \205// RUN: -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-ON %s206 207// RUN: %clang -### -Werror -ffp-contract=fast -fno-unsafe-math-optimizations \208// RUN: -ffp-contract=off \209// RUN: -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-OFF %s210 211// RUN: %clang -### -Werror -ffp-contract=off -fno-unsafe-math-optimizations \212// RUN: -ffp-contract=fast \213// RUN: -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-FAST %s214 215// RUN: %clang -### -Werror -ffp-contract=off -fno-unsafe-math-optimizations \216// RUN: -ffp-contract=on -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-ON %s217 218// RUN: %clang -### -Werror -ffp-contract=on -funsafe-math-optimizations -c %s 2>&1 \219// RUN:   | FileCheck --check-prefix=CHECK-FPC-FAST %s220 221// RUN: %clang -### -Werror -ffp-contract=off -funsafe-math-optimizations -c %s 2>&1 \222// RUN:   | FileCheck --check-prefix=CHECK-FPC-FAST %s223 224// RUN: %clang -### -Werror -ffp-contract=fast -funsafe-math-optimizations -c %s 2>&1 \225// RUN:   | FileCheck --check-prefix=CHECK-FPC-FAST %s226 227// RUN: %clang -### -Werror -ffp-contract=on -funsafe-math-optimizations -fno-unsafe-math-optimizations -c %s 2>&1 \228// RUN:   | FileCheck --check-prefix=CHECK-FPC-ON %s229 230// RUN: %clang -### -Werror -ffp-contract=off -funsafe-math-optimizations -fno-unsafe-math-optimizations -c %s 2>&1 \231// RUN:   | FileCheck --check-prefix=CHECK-FPC-OFF %s232 233// RUN: %clang -### -Werror -ffp-contract=fast -funsafe-math-optimizations -fno-unsafe-math-optimizations -c %s 2>&1 \234// RUN:   | FileCheck --check-prefix=CHECK-FPC-FAST %s235 236// RUN: %clang -### -Werror -fno-unsafe-math-optimizations -funsafe-math-optimizations \237// RUN:   -ffp-contract=fast \238// RUN: -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-FAST %s239 240// RUN: %clang -### -fno-unsafe-math-optimizations -funsafe-math-optimizations \241// RUN:   -ffp-contract=on -c %s 2>&1 | FileCheck --check-prefixes=CHECK-FPC-ON,WARN_UM_ON %s242 243// RUN: %clang -### -fno-unsafe-math-optimizations -funsafe-math-optimizations \244// RUN:   -ffp-contract=off -c %s 2>&1 | FileCheck --check-prefixes=CHECK-FPC-OFF,WARN_UM_OFF %s245 246// RUN: %clang -### -funsafe-math-optimizations -ffp-contract=off -c %s 2>&1 \247// RUN:   | FileCheck --check-prefix=WARN_UM_OFF %s248 249// This case should not warn250// RUN: %clang -### -Werror -funsafe-math-optimizations \251// RUN: -fno-unsafe-math-optimizations -ffp-contract=off -c %s252 253// RUN: %clang -### -ffast-math -ffp-contract=off -c %s 2>&1 \254// RUN:   | FileCheck --check-prefix=WARN_FM_OFF %s255 256// This case should not warn257// RUN: %clang -### -Werror -ffast-math -fno-fast-math -ffp-contract=off -c %s258